incorrect warning
Ulrich Drepper
drepper@cygnus.com
Fri Jun 5 10:18:00 GMT 1998
Hi,
this little piece of code (Intel specific, but you get the idea how to
do it on other platforms) produces a warning which isn't correct and
cannot be avoided:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ cat u.c
int
main ()
{
register int ebp asm ("ebp");
return ebp != 0;
}
$ gcc -Wall -O -o u u.c
u.c: In function `main':
u.c:4: warning: `ebp' might be used uninitialized in this function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
One cannot assign to the variable and therefore gcc should not print
the warning at all.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
More information about the Gcc-bugs
mailing list