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: Standards compliant preprocessor arithmetic


On Mon, 27 May 2002, Neil Booth wrote:

> Geoff Keating wrote:-
> 
> > The c99 semantics are compliant with the c89 semantics, because of the
> > 'at least'.  I'd recommend that we allow the c89 cpp to perform
> > arithmetic to the size of at least the target's "long long".
> 
> I'm going to apply the patch as I originally posted it for this bit.
> I'd like to know what Joseph and Zack think about this; if there's
> agreement I'm happy to change it; it's only the one line (plus the
> testsuite arith-2.c).

Though the standard allows laxity here, I don't think it's a particularly
good idea to use it (to treat target long as longer than it is), any more
than it's a good idea to use laxity about whether character constants in
#if have the same values as they do elsewhere.  OTOH long long is
supported as an extension in C89 mode and if long long values are
explicitly used it would be desirable for them to work in #if.

While dealing with the technicalities of standards requirements for
preprocessor arithmetic: if these tests don't cover the case of DR#265, a
test of that case should be added somewhere.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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