aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2020-10-12 17:19:39 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2020-10-13 15:48:40 +1100
commit04cf1fdc0fcf471c2e77376101bda65f727b3812 (patch)
treefb5880b647f348e584bbdac1ee0308a8c062bc09
parentb30013edb878a0e4fbe7235f38d8fd6e644479e5 (diff)
downloaddtc-04cf1fdc0fcf471c2e77376101bda65f727b3812.tar.gz
convert-dtsv0: Fix signedness comparisons warning
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in the generated lexer code. In this case we walk over an array, and never use negative indicies, so we can change the loop counter variable to be unsigned. This fixes "make convert-dtsv0", when compiled with -Wsign-compare. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201012161948.23994-3-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--convert-dtsv0-lexer.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/convert-dtsv0-lexer.l b/convert-dtsv0-lexer.l
index f52e8a1..7a66f57 100644
--- a/convert-dtsv0-lexer.l
+++ b/convert-dtsv0-lexer.l
@@ -94,7 +94,7 @@ static const struct {
<INITIAL>[0-9a-fA-F]+ {
unsigned long long val;
int obase = 16, width = 0;
- int i;
+ unsigned int i;
val = strtoull(yytext, NULL, cbase);