When I compiled my C++ code with GCC 4.3 for the first time, (after having compiled it successfully with no warnings on 4.1, 4.0, 3.4 with the -Wall -Wextra opt
-Wall -Wextra
This warning is also useful to avoid confusion when declaring functions returning pointers to objects which should not be modified:
// "warning: type qualifiers ignored on function return type" // as the pointer is copied. Foo* const bar(); // correct: const Foo* bar();