-Wsign-compare makes gcc complain about bool?unsigned:signed
Martin Str|mberg
ams@ludd.luth.se
Sun Mar 17 06:52:00 GMT 2002
- Previous message (by thread): target/5985: fix_truncMN2 (e.g. fix_truncdfdi) and fixuns_truncMN2 incorrect on a29k, alpha, arm, c4x, dsp16xx, i370, i386, ia64, m88k, mips, ns32k, pj, romp, rs6000, s390, sh, xtensa
- Next message (by thread): java/5986: SIGSEGV in __gcj_personality_v0
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
gcc --version reports:
3.04
My platform is DJGPP (run in WINDOZE 98).
This program
#include <stdio.h>
int main(void)
{
unsigned int u;
int s;
unsigned long long ll = u?u:s;
printf("ll = %llu.\n", ll);
return( 0 );
}
compiled with "gcc -O2 -g -Wall c.c -o c -Wsign-compare" gives
c.c: In function `main':
c.c:8: warning: signed and unsigned type in conditional expression
c.c:5: warning: `u' might be used uninitialized in this function
c.c:6: warning: `s' might be used uninitialized in this function
I have no problem with line 5 and 6.
But line 8. Why is that wrong? And why does -Wsign-compare trigger
this warning when it's not a comparison?
Right,
MartinS
- Previous message (by thread): target/5985: fix_truncMN2 (e.g. fix_truncdfdi) and fixuns_truncMN2 incorrect on a29k, alpha, arm, c4x, dsp16xx, i370, i386, ia64, m88k, mips, ns32k, pj, romp, rs6000, s390, sh, xtensa
- Next message (by thread): java/5986: SIGSEGV in __gcj_personality_v0
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Gcc-bugs
mailing list