From 9b9666838eb8b3101bf461ae5e919b415657a0d1 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 7 Oct 2015 13:58:26 +0200 Subject: [PATCH] ldlex: Fix sign-compare warning, suppress -Wstack-usage. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 +++++ src/Makefile.am | 1 + src/ldlex.l | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) 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++]); -- 2.47.3