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: Your binutils patch today caused a "fatal warning"


On Mon, Jun 20, 2005 at 03:41:51PM +0200, Andreas Schwab wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
> 
> > Works for me just fine.
> >         if (hdr->sh_entsize != (hdr->sh_type == SHT_REL
> >                                 ? bed->s->sizeof_rel : bed->s->sizeof_rela))
> >           return FALSE;
> >
> > Now, sizeof_rel and sizeof_rela are unsigned char, hdr->sh_entsize
> > is bfd_size_type, which ought to be unsigned type.
> 
> unsigned char gets promoted to int, thus the warning is correct.

I know very well it promotes to int.  Still, GCC knows there was
a smaller unsigned type promoted to that signed int and that it will
be always non-negative, so it can avoid the unnecessary warning.

	Jakub


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