Is the result of offsetof an integral constant expression?

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Jun 3 16:42:00 GMT 2003


Steve Clamage <stephen.clamage@sun.com> writes:

| To: C++ core language mailing list
| Message c++std-core-9966
| 
| >Message c++std-core-9965, David Abrahams
| >
| >The title says it all.  Well, the following link provides some color:
| >http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11072
| 
| I don't follow the argument in bugzilla that says the wording in the
| C standard doesn't apply.  Why doesn't it apply?  The C++ standard
| just lists restrictions on applying offsetof to C++ features that
| don't exist in C.

I think the argument in the bugzilla is just wrong.  The compiler is
indeed defectuous and the PR is a valid one.

Wolfgang, there is no dispute that offsetof should yield a constant
integral expression.  That GCC fails to provide a correct definition
is a bug. 

-- Gaby



More information about the Gcc-bugs mailing list