This is the mail archive of the gcc@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: using offsetof with g++


Matt Austern writes:
 > It's there: -Wno-invalid-offsetof

Thanks.  Too bad it didn't make it into 3.3.2.  Oh well.

 > P.S.  Oh, and the language citation in question is from clause 18.1p5 
 > of the
 > C++ Standard: "The macro offsetof accepts a restricted set of type 
 > arguments
 > in this International Standard.  type shall be a POD structure or a POD
 > union."

Thanks.

 > The word "shall" in this clause means that our compiler is required to 
 > issue
 > a diagnostic for invalid uses.  If we fail to issue a diagnostic, then 
 > the compiler
 > does not conform to the standard.  Test suites should, and do, check 
 > this.

Depending on settings of things like -pedantic, of course.


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