This is the mail archive of the
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: <firstname.lastname@example.org>
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;
> - 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. :)
IBM OzLabs - Linux Technology Centre