Warn about character literals not of length one.

* NEWS (2.5): Document.
* src/scan-gram.l (INITIAL): Remove comment that we don't check
the length.
(SC_ESCAPED_CHARACTER): Warn if length is wrong.
* tests/input.at (Bad character literals): New test group.
(cherry picked from commit ac9b0e954b)
This commit is contained in:
Joel E. Denny
2009-07-24 10:29:07 -04:00
parent 13cdf208ed
commit 3208e3f4d9
4 changed files with 108 additions and 8 deletions

13
NEWS
View File

@@ -133,6 +133,19 @@ Bison News
about a missing semicolon where it did not before. Future releases of
Bison will cease to append semicolons entirely.
** Character literals not of length one.
Previously, Bison quietly converted all character literals to length
one. For example, without warning, Bison interpreted the operators in
the following grammar to be the same token:
exp: exp '++'
| exp '+' exp
;
Bison now warns when a character literal is not of length one. In
some future release, Bison will report an error instead.
* Changes in version 2.4.2 (????-??-??):
** %code is now a permanent feature.