Skip to content

Fix warnings

Chris Cantwell requested to merge fix/warnings into master

The MR turns on more pedantic compiler warnings and addresses those which then arise. The majority of warnings were of the following types:

  • Unused parameters: These occur most often when the specialised implementation of a virtual function does not use all of the parameters provided by the interface. There are several approaches to address this, including:

    1. removing the parameter identifier in the function prototype,
    2. commenting-out the parameter identifier to retain the meaning, and
    3. declaring a dummy use of the parameter to suppress the warning.

    The latter was chosen, specifically implemented using boost::ignore_unused(), as this sometimes occurs when a parameter is used only in debug mode, which precluded the other options.

  • Variable may be used uninitialised: Appropriate default values were given.

  • Use of constants in conditionals: This mostly appeared due to assertions of the form ASSERTL0(false, "msg");. These were replaced with NEKERROR(ErrorUtil::efatal, "msg") to avoid the conditional expression.

Edited by Chris Cantwell

Merge request reports