This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: fixes for type-punning warnings in GCC 4.1
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 20 Dec 2005 00:10:00 +0200
- Subject: Re: fixes for type-punning warnings in GCC 4.1
- References: <ork6e0nban.fsf@livre.oliva.athome.lsd.ic.unicamp.br>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Alexandre Oliva <aoliva@redhat.com>
> Date: Mon, 19 Dec 2005 17:20:48 -0200
>
> This patch fixes the type-punning warnings that the GCC 4.1 branch
> issues when compiling the GDB code base.
> [...]
> - num = sscanf (p, "%g%s", (float *) &putithere->typed_val_float.dval,s);
> + num = sscanf (p, "%g%s", (float *) (void *) &putithere->typed_val_float.dval,s);
If this is the fix, then forgive me, but I'd prefer not to fix it at
all, 'cause it's so UUUGLYYYY! If we can use some command-line switch
to GCC to shut it up, let's do that instead. Failing that, let's just
leave the code alone, so that GCC's continued whining stands as a token
of our unappreciation to compilers that should have known better!
Thanks for working on this, anyway.