This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
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