This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: invalid offsetof from non-POD type
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: John Quigley <johnw at lowestplane dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 21 Apr 2003 14:54:21 +0100
- Subject: Re: invalid offsetof from non-POD type
- Organization: Codesourcery LLC
- References: <200304202211.03599.johnw@lowestplane.org>
John Quigley wrote:
The code below triggers an "invalid offsetof from non-POD type" warning:
In this case, and in every case I've seen, the warning is a false alarm and
the compiler produces the correct result. Is there a case where the warning
fires and the compiler produces an incorrect result? (i.e.: returns the
wrong offset)? If there is no such case, is there anything wrong with
providing a command line flag in gcc that allows the user to disable this
warning?
offsetof may only be applied to POD types. [18.1]/5
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org