This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: cpplib: Multichar charconst changes


On Sun, May 05, 2002 at 09:34:45PM +0100, Neil Booth wrote:
> Neil Booth wrote:-
> 
> > Incidentally, looking into this made me think we don't do the right
> > thing for multi-character charconsts.  We give them the same signedness
> > as target char; I tend to think they should be signed just like their
> > "int" type is.  Also, if target char is signed, we calculate their value
> > in the most wacky way, since each char's value is not sign-extended
> > to int, but kept in the narrow target char and or-ed into the target int.
> > Finally, in view of the way we calculate their value (first char is most
> > significant), it seems odd to ignore excess trailing chars rather than
> > excess leading chars like normal C arithmetic would when overflowing.
> 
> This is addressed with the patch below which has bootstrapped and
> regtested (apart from what appears to be one of the format-checking
> heisen-failures).  It only affects multichar charconsts.  Do you object
> to my applying it Zack?

I am mildly concerned about breaking things with this, but I do like
the consistency it brings.  If you document the change, fine by me.

zw


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