https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114526
--- Comment #6 from Harald van Dijk <harald at gigawatt dot nl> --- (In reply to Joseph S. Myers from comment #5) > The -pedantic documentation was updated to reflect reality - that the option > is about more than just when diagnostics are required by ISO C ("forbidden > extensions" can be taken, in the C case, as meaning those that involve > constraint violations or are outside the standard C syntax) but covers some > other programs doing things not defined in ISO C as well - in commit > 074e95e34275d72664f997ed949d9c91e37cd6ee (July 2000). I don't think any > possible narrower intent there may have been long before then is > particularly relevant now. Actually, the narrower intent is still documented at <https://gcc.gnu.org/onlinedocs/gcc/Warnings-and-Errors.html>. Arguably, this behaviour makes -ansi -pedantic-errors a non-conforming implementation because it rejects code that is only undefined at runtime, which ISO C requires implementations to accept unless the implementation can prove the code is reached.