PATCH: don't sign-extend address in ihex files
Ian Lance Taylor
ian@airs.com
Wed May 14 16:41:00 GMT 2003
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
More information about the Binutils
mailing list