https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114526
--- Comment #9 from Harald van Dijk <harald at gigawatt dot nl> --- (In reply to Joseph S. Myers from comment #8) > "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. Bug 83584, which like this one is closed as a duplicate of 11234, is about exactly that. void *f(void) { return (void *)f; } int main(void) { return 0; } This is a strictly conforming program. It violates no syntax rule or constraint, and exhibits no translation-time undefined behaviour, yet it triggers a pedwarn, turning into an error with -pedantic-errors. It would have undefined behaviour i f f were ever called, but it is not called.