From 91a2af97537949caab7fd8fdb330eb92401f390c Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Wed, 29 Jul 2009 13:47:02 -0400 Subject: [PATCH] Fix a --enable-gcc-warnings problem. * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length variable. (cherry picked from commit a1ed2b71faac0de1db1c0e279ee3203115ec70d8) --- ChangeLog | 6 ++++++ src/scan-gram.l | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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') -- 2.45.2