This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to cp/decl.c: Timing name lookup
"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> On Thu, 13 Feb 2003, Zack Weinberg wrote:
> > stdio-common/vfprintf.c has a huge static table of initializers of the
> > form &&label2 - &&label1.
>
> I'd hope such tables can change to using __constant_expression__ (with an
> appropriate macro definition for older GCC) rather than requiring GCC to
> keep additional types of constant expressions beyond the single extension
> (__constant_expression__(EXPR), "treat this expression as a constant
> expression if it can be folded") needed to make offsetof constant.
I would prefer that we keep this as an extension, that the difference
of the addresses of labels is a constant expression. It's an
important usage, the only point of it is to be used as a constant
expression in initializers, and it can't cause people to accidentally
write nonstandard code because taking the address of a labels is
already nonstandard.
--
- Geoffrey Keating <geoffk@geoffk.org>