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: PATCH: don't sign-extend address in ihex files


Alan Modra <amodra@bigpond.net.au> writes:

> On Tue, May 13, 2003 at 03:03:09PM -0500, Jim Blandy wrote:
> > Since the value of the hex_value
> > macro (defined in libiberty.h) is signed
> 
> Except when char is unsigned, which is another argument in favour of
> your patch.

Well, since ANSI C is value preserving rather than unsignedness
preserving, you still need the cast to unsigned int.  Otherwise
unsigned char promotes to signed int when used in an expression.

Still, arguably the _hex_value array should be unsigned char rather
than simply char.

Ian


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