diff options
author | Joel E. Denny <jdenny@clemson.edu> | 2009-07-29 13:47:02 -0400 |
---|---|---|
committer | Joel E. Denny <jdenny@clemson.edu> | 2009-07-29 13:49:25 -0400 |
commit | 91a2af97537949caab7fd8fdb330eb92401f390c (patch) | |
tree | 23f1401557eb815e51e7898d14f469d3650b7545 | |
parent | 3208e3f4d9aff080a546685560536336f0852bcb (diff) | |
download | bison-91a2af97537949caab7fd8fdb330eb92401f390c.tar.gz |
Fix a --enable-gcc-warnings problem.
* src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
variable.
(cherry picked from commit a1ed2b71faac0de1db1c0e279ee3203115ec70d8)
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/scan-gram.l | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu> + + Fix a --enable-gcc-warnings problem. + * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length + variable. + 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu> Warn about character literals not of length one. diff --git a/src/scan-gram.l b/src/scan-gram.l index 5c0418c6..a6bd5e2f 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -500,9 +500,9 @@ splice (\\[ \f\t\v]*\n)* { /* FIXME: Eventually, make these errors. */ size_t length = strlen (last_string); - if (strlen (last_string) < 3) + if (length < 3) warn_at (*loc, _("empty character literal")); - else if (strlen (last_string) > 3) + else if (length > 3) warn_at (*loc, _("extra characters in character literal")); } if (yytext[0] == '\n') |