C constant expressions proposals

Geoffrey Keating geoffk@geoffk.org
Tue Aug 17 21:38:00 GMT 2004


"Joseph S. Myers" <jsm@polyomino.org.uk> writes:

> On Sat, 14 Aug 2004, Zack Weinberg wrote:
> 
> > Since you specifically ask about 20010327-1.c, I think it looks
> > awfully like the sort of code that people write down in the guts of an
> > operating system, and I think we have broken those people's code a lot
> > and maybe we should think about cutting them some slack.
> 
> It's only the version with a cast to an integer of different width that's 
> a problem (and specifically when longs are a different width from 
> pointers).  The case of a cast to an integer of the same width is 
> 20011114-1.c, which I propose to keep valid.

The point of 20010327-1.c is that it's the only way to get certain
functionality out of the linker.  It's necessary for strange cases
involving, for instance, an interface between 32-bit and 64-bit code.
It's perfectly OK if this is only accepted in an initializer, but it
does need to be accepted.



More information about the Gcc mailing list