This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: possible bug
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Andrew Morton <akpm at digeo dot com>, gcc at gcc dot gnu dot org
- Date: 31 Jan 2003 01:49:34 -0200
- Subject: Re: possible bug
- Organization: GCC Team, Red Hat
- References: <3E39BF1D.A0D038EF@digeo.com><20030131001301.GJ15049@kam.mff.cuni.cz>
On Jan 30, 2003, Jan Hubicka <jh@suse.cz> wrote:
>> char *zot(void)
>> {
>> return ({foo(); 0; });
>> }
>> mnm:/home/akpm> /usr/local/gcc-3.2.1/bin/gcc -O -Wall -c t.c
>> t.c: In function `zot':
>> t.c:10: warning: return makes pointer from integer without a cast
>> I think the warning is bogus?
> I think the value of ({foo(); 0; }) is zero (value of last statement,
> if I recall the definition), so it is corect.
But then, zero is a NULL pointer constant, isn't it? At least in C++,
a warning would have been very inappropriate. I don't think one for C
is.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer