This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [committed] fix new warning in symbols.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]