From: Mark Wielaard Date: Wed, 7 Oct 2015 11:58:26 +0000 (+0200) Subject: ldlex: Fix sign-compare warning, suppress -Wstack-usage. X-Git-Tag: elfutils-0.164~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b9666838eb8b3101bf461ae5e919b415657a0d1;p=thirdparty%2Felfutils.git ldlex: Fix sign-compare warning, suppress -Wstack-usage. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index ef09a091e..796878f8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-10-07 Mark Wielaard + + * Makefile.am (ldlex_no_Wstack_usage): New. + * ldlex.l ([RWX]): Make cnt unsigned. + 2015-10-09 Josh Stone * elflint.c (main): Replace stat64 and fstat64 with stat and fstat. diff --git a/src/Makefile.am b/src/Makefile.am index afb38fc0f..04ae3cbc5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -89,6 +89,7 @@ endif # XXX While the file is not finished, don't warn about this ldgeneric_no_Wunused = yes ldgeneric_no_Wstack_usage = yes +ldlex_no_Wstack_usage = yes # Bad, bad stack usage... readelf_no_Wstack_usage = yes diff --git a/src/ldlex.l b/src/ldlex.l index bfc8bbe53..835c2dc16 100644 --- a/src/ldlex.l +++ b/src/ldlex.l @@ -146,7 +146,7 @@ SIZEOF_HEADERS { return kSIZEOF_HEADERS; } SORT { return kSORT; } VERSION { return kVERSION; } -"["([RWX]){0,3}"]" { int cnt = 1 ; +"["([RWX]){0,3}"]" { unsigned int cnt = 1 ; ldlval.num = 0; while (cnt < yyleng - 1) ldlval.num |= attrib_convert (yytext[cnt++]);