[Bug c++/19291] Warning "cannot pass objects of non-POD type" should be an error
redi at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Aug 13 12:51:00 GMT 2009
------- Comment #6 from redi at gcc dot gnu dot org 2009-08-13 12:51 -------
(In reply to comment #3)
> I totally agree with David Faure, please make this warning controllable:
> -Werror=invalid-offsetof
>
> All other warnings have a type that can be ignored, but when using the
> -fdiagnostics-show-option option to see what the warning type is for this
> non-POD warning I was amazed that it does not have a type. In the
> gcc/Warnings-Options.html the type is listed as invalid-offsetof
I don't think the docs do say that. -Winvalid-offsetof may be related to
non-POD types but is distinct from this error.
(In reply to comment #5)
> You have to read the relevant standard text carefully to determine whether
> it is the program that is undefined, or a particular execution of the
> program, in this particular instance of undefined behavior. If the
> undefinedness is a property of the program (for example, ODR violation),
> translation may be terminated. If the undefinedness is a property of a
> particular execution of the program (for example, signed integer
> overflow), translation may not be terminated unless all possible
> executions of the program exhibit that undefined behavior.
Passing a non-POD class type to a variadic function is a property of the
program, detectable at compile time, so I think it would be conforming to make
it an error (please correct me if I've misunderstood.)
I don't feel strongly about making it always an error, but I disagree that this
request is INVALID because the standard forbids making it an error. It seems
like a valid enhancement to add a new warning option so this users can choose
to make it an error.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19291
More information about the Gcc-bugs
mailing list