dgibson / dtc

Device Tree Compiler
218 stars 130 forks source link

adding -Wsign-compare broke ppc64 build #50

Closed sharkcz closed 3 years ago

sharkcz commented 3 years ago

Commit 72d09e2682a41589b46b8cdd4c393b8ed47ac266 introducing the -Wsign-compare compiler option broke our builds on ppc64 (big endian). The system is Fedora 28 with gcc-8.3.1-2.fc28.ppc64 and flex-2.6.1-7.fc28.ppc64

...
cc -I libfdt -I . -DFDT_ASSUME_MASK=0 -g -Os -fPIC -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs -Wsign-compare -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow  -I/usr/include/valgrind   -o convert-dtsv0-lexer.lex.o -c convert-dtsv0-lexer.lex.c
convert-dtsv0-lexer.lex.c: In function 'yy_scan_bytes':
convert-dtsv0-lexer.lex.c:1789:17: error: comparison of integer expressions of different signedness: 'yy_size_t' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare]
  for ( i = 0; i < _yybytes_len; ++i )
                 ^
cc1: all warnings being treated as errors

I suspect the fix is to use newer flex ...

sharkcz commented 3 years ago

And yup, https://src.fedoraproject.org/rpms/flex/c/967afaa6d03d053f00d05592a5bdf7cfa5a40fee?branch=f29 is the fix for flex.