I think switching to c99 per default is a great idea. The problem below should be fixed by http://review.coreboot.org/#/c/11666/ and the following patch.
Stefan
On Oct 19, 2015, Julius Werner jwerner@chromium.org wrote:
is there anyway to dynamic define std to gnu99 when detect build with
cygwin?
cbfstool is already defining -std=c99. I don't see a strong reason why we shouldn't just change that to gnu99 globally.
- default build will error as below,
HOSTCC cbfstool/cbfstool.o /cygdrive/d/FW/coreboot/util/cbfstool/cbfstool.c: In function
'main':
/cygdrive/d/FW/coreboot/util/cbfstool/cbfstool.c:1075:5: error:
array
subscript has type 'char' [-Werror=char-subscripts] if (tolower(suffix[0])=='k') { ^
This sounds like an bug in cygwin and you should file it with them. They're probably implementing tolower() in their standard header as a macro which directly indexes an array with an argument. They should at least be casting the argument inside that macro or they are not POSIX-compliant.