This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [committed] fix new warning in symbols.c
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 11 Apr 2005 09:45:46 +0930
- Subject: Re: [committed] fix new warning in symbols.c
- References: <1113176453.5213.5.camel@localhost.localdomain>
On Sun, Apr 10, 2005 at 04:40:53PM -0700, Eric Christopher wrote:
> Alan's recent patch to fix gas/827 trips a warning under gcc4 on
> symbols.c. Adding the cast fixes the problem trivially.
Yes, I didn't compile with gcc4..
> --- symbols.c 9 Apr 2005 03:48:09 -0000 1.57
> +++ symbols.c 10 Apr 2005 23:27:48 -0000
> @@ -2032,7 +2032,7 @@ symbol_X_add_number (symbolS *s)
> return &((struct local_symbol *) s)->lsy_value;
> #endif
>
> - return &s->sy_value.X_add_number;
> + return (valueT *)&s->sy_value.X_add_number;
Slightly better is to return the same type as sy_value.X_add_number, and
cast lsy_value. I've made that change, and would have beaten you to the
commit if I hadn't been properly testing it. :)
--
Alan Modra
IBM OzLabs - Linux Technology Centre