https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114526

--- Comment #8 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
"rejects", in the ISO C sense, only applies to errors and pedwarns in GCC; not
to warnings conditional on -pedantic (of which there are also some, but which
don't turn into errors with -pedantic).

If you have cases where something that is only *undefined as a property of a
particular execution of the program* (as opposed to undefined as a property of
a translation unit or of the collection of translation units making up a
program, or violating a Constraint or syntax rule) but that are errors or
pedwarns, those should be reported as separate bugs. There are various cases
where we make sure to only warn at compilation time and generate code that
aborts at precisely the point in execution where undefined behavior would
occur, precisely because the undefined behavior in those cases is a property of
a program execution.

I believe conversions between function and object pointers are undefined as a
property of the translation unit - not of a particular execution. Whereas e.g.
calling a function pointer converted to an incompatible type is undefined as a
property of a particular execution (the undefinedness only occurring when the
call itself is executed, after all side effects from the function designator
and arguments have taken place).

Reply via email to