delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-workers-bounces using -f |
From: | Martin Str|mberg <ams AT ludd DOT luth DOT se> |
Message-Id: | <200203171452.g2HEqVZ04604@speedy.ludd.luth.se> |
Subject: | -Wsign-compare makes gcc complain about bool?unsigned:signed |
To: | gcc-bugs AT gcc DOT gnu DOT org |
Date: | Sun, 17 Mar 2002 15:52:31 +0100 (CET) |
CC: | DJGPP-WORKERS <djgpp-workers AT delorie DOT com> |
X-Mailer: | ELM [version 2.4ME+ PL78 (25)] |
MIME-Version: | 1.0 |
Reply-To: | djgpp-workers AT delorie DOT com |
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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |