AW: [En-Nut-Discussion] -Wsign-compare warnings
Oliver Schulz
olischulz at web.de
Thu Oct 14 17:43:09 CEST 2004
Hi Matthias,
thanks for that advise. I will check these locations and others.
Modifications if finished are commited to cvs.
Cheers,
Oliver.
> -----Ursprungliche Nachricht-----
> Von: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Matthias
> Ringwald
> Gesendet: Donnerstag, 14. Oktober 2004 15:12
> An: Ethernut User Chat (English)
> Betreff: [En-Nut-Discussion] -Wsign-compare warnings
>
>
> hi
>
> my colleague tried to compile our subset of the ethernut 3.5.0 CVS
> sources with an older avr-gcc
> which had -Wsign-compare enabled as default. compiling
> ethernut failed
> because of some comparisons
> between signed and unsigned variables in gmtime.c localim.c
> and usart.c.
> (...log attached)
>
> anybody volunteering to check those (there might be more
> locations, as
> we only used a subset)
> location and fix them to not produce warnings?
>
> in our bt stack, those warnings actually turned out to hint a
> potential
> bug, which in our
> software probablity would not be triggerd, but better to fix on time
> than to debug later.
>
> what about more warnings per default ?
>
> matthias
>
>
> avr-gcc -c -mmcu=atmega128 -Os -Wsign-compare -Wall
> -Wstrict-prototypes
> -Wa,-ahlms=gmtime.btnode2.lst -D__HARVARD_ARCH__
> -DNUT_CPU_FREQ=7372800
> -DNUTRAMEND=0xFFFF -D__BTNODE2__ -I../../btnode/include
> -I../../nut/include gmtime.c -o gmtime.btnode2.o
> gmtime.c: In function `gmtime_r':
> gmtime.c:109: warning: comparison between signed and unsigned
> gmtime.c:112: warning: comparison between signed and unsigned
> gmtime.c:116: warning: comparison between signed and unsigned
>
> avr-gcc -c -mmcu=atmega128 -Os -Wsign-compare -Wall
> -Wstrict-prototypes
> -Wa,-ahlms=localtim.btnode2.lst -D__HARVARD_ARCH__
> -DNUT_CPU_FREQ=7372800 -DNUTRAMEND=0xFFFF -D__BTNODE2__
> -I../../btnode/include -I../../nut/include localtim.c -o
> localtim.btnode2.o
> localtim.c: In function `localtime_r':
> localtim.c:76: warning: comparison between signed and unsigned
> localtim.c:76: warning: comparison between signed and unsigned
>
> avr-gcc -c -mmcu=atmega128 -Os -Wsign-compare -Wall
> -Wstrict-prototypes
> -Wa,-ahlms=usart.btnode2.lst -D__HARVARD_ARCH__
> -DNUT_CPU_FREQ=7372800
> -DNUTRAMEND=0xFFFF -D__BTNODE2__ -I../../btnode/include
> -I../../nut/include usart.c -o usart.btnode2.o
> usart.c: In function `UsartRead':
> usart.c:231: warning: comparison between signed and unsigned
>
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
More information about the En-Nut-Discussion
mailing list