This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: warning: cannot pass objects of non-POD type ‘ class A’ through ‘...’; call will abort at runtim e
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Martin Olsson <martin at minimum dot se>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 15 Apr 2010 18:53:16 +0200
- Subject: Re: warning: cannot pass objects of non-POD type ‘ class A’ through ‘...’; call will abort at runtim e
- References: <36360.213.236.208.22.1271348668.squirrel@www.scorpiondata.com>
On 15 April 2010 18:24, Martin Olsson <martin@minimum.se> wrote:
>
> 1. Why is this a "warning" rather than an "error"? When I run the program
> it hits a "ud2a" instruction emitted by gcc and promptly hits SIGILL.
See the discussion in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19291
Basically, the C++ standard seems to say that this cannot be a hard-error.
> 2. Is there a command line switch that I can use to make GCC treat this
> particular warning as an error?
That is the reason the PR is still open. I will try to get it for GCC 4.6.
> 3. If I make A::a member public rather than private then A gets classified
> as a POD and the warning goes away. I find this a bit strange, because I
> always thought that "private" versus "public" was a "compile time concept"
> that has no impact on the emitted binary?
Weird. I do not know what is going on there.
Cheers,
Manuel.