Skip to content

Compiler Warnings and Errors

Samuel Browne edited this page Dec 3, 2024 · 2 revisions

In the interest of making Trilinos software packages as easy to use as possible, we maintain a list of compiler warnings that must be clean prior to merging changes to the Trilinos project.

Warning Types

  1. upcoming warnings

    These warnings are set to WARNINGS in all of our GCC-based Pull Request CI builds. The idea is to make them visible to developers, but not to block Pull Request integration at the current time. They will be upgraded to promoted warnings (errors) at some point in the future, pending an announcement to the community.

  2. promoted warnings (errors)

    These warnings are set to ERRORS in all of our GCC-based Pull Request CI builds. Any changes to currently-supported Trilinos packages* must not contain any of these compiler warnings.

The current list of upcoming and promoted warnings can be seen in this file.

* Deprecated packages will not have upcoming or promoted warnings applied to them.

User Settings

There are several ways to configure/build Trilinos packages such that these warnings/errors are engaged or not, depending on user preference. They are controlled via the Trilinos_WARNINGS_MODE CMake variable, which can have the following values:

  1. WARN

    If the value is set to WARN, then upcoming warnings will be turned on as WARNINGS via the -W<warning> -Wno-error=<warning> options. promoted warnings will be turned on as ERRORS via the -Werror=<warning> option.

  2. ERROR

    If the value is set to ERROR, then both upcoming and promoted warnings will be turned on as ERRORS via the -Werror=<warning> option.

  3. Any other value

    If the value is anything else, neither promoted nor upcoming warnings will be turned on at all.

Additionally, the value of the Trilinos_ADDITIONAL_WARNINGS variable will be appended to upcoming warnings, such that users can easily test out adding additional warnings to builds (via standard CMake semicolon separated lists).

Clone this wiki locally