Wednesday, August 13, 2014

Project – Compiler Warnings

In [Stroustrup, 2013], he frequently mentions that for questionably formed C++ statements that the compiler should issue a warning.  This made me realize that only the default warnings in the compiler were being used.  To possibly catch more problems, all of the warnings were enabled using the following GCC compiler options:
-Wall       enable all (well actually most) warnings
-Wextra     enable warnings not enabled by -Wall
-pedantic   enable warnings demanded by strict ISO C++ standard
-Werrors    cause compiler to treat warnings as errors
The last option causes the compiler to abort after issuing a warning instead of proceeding, which will require the warning to be corrected; however, this does not affect warnings from pedantic option, therefore the -pendantic-errors was used instead, which has the same affect.  After adding these options, several warnings were reported, which were of six different types.  Click Continue... for details of these warning types that were corrected.  Since this commit is development related and not specific to any topic, the commit was just made to the develop branch.

[commit bb0124444f]