$ man g++ | grep "\-pedantic$" -A28
-pedantic
Issue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden
extensions, and some other programs that do not follow ISO C and ISO C++. For ISO C, follows the
version of the ISO C standard specified by any -std option used.
Valid ISO C and ISO C++ programs should compile properly with or without this option (though a rare
few require -ansi or a -std option specifying the required version of ISO C). However, without this