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: C++ PATCH to cp/decl.c: Timing name lookup


"Joseph S. Myers" <jsm28@cam.ac.uk> writes:

> We do need one extension to integer constant expressions so that offsetof 
> yields one.  For now we simply allow expressions like those in offsetof as 
> constant; to get things correct, those sorts of expressions need to be a 
> new type, "symbolic difference constant expressions" (see previous 
> discussion <http://gcc.gnu.org/ml/gcc-patches/2000-11/msg00707.html> - 
> though it isn't clear from that discussion that they do need to be 
> recognised as constant expressions in initializers at all, just folded for 
> optimization.

People definitely use offsetof() in initializers, and glibc
stdio-common/vfprintf.c has a huge static table of initializers of the
form &&label2 - &&label1.

zw


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