From: Joel E. Denny Date: Wed, 29 Jul 2009 17:47:02 +0000 (-0400) Subject: Fix a --enable-gcc-warnings problem. X-Git-Tag: v2.7.90~838 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/91a2af97537949caab7fd8fdb330eb92401f390c Fix a --enable-gcc-warnings problem. * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length variable. (cherry picked from commit a1ed2b71faac0de1db1c0e279ee3203115ec70d8) --- diff --git a/ChangeLog b/ChangeLog index a67b8ca2..602f1fdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-29 Joel E. Denny + + Fix a --enable-gcc-warnings problem. + * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length + variable. + 2009-07-24 Joel E. Denny 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')