This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
incorrect warning
- To: egcs-bugs at cygnus dot com
- Subject: incorrect warning
- From: Ulrich Drepper <drepper at cygnus dot com>
- Date: 05 Jun 1998 10:17:45 -0700
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
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 `------------------------