-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement user-selectable compiler warning switches #60
Comments
Imported from trac issue 37. Created by jphickey on 2015-04-17T14:18:14, last modified: 2015-11-20T16:22:16 |
Trac comment by jphickey on 2015-04-17 14:52:46: Commit [changeset:f46224c] has been pushed for this The extra flags are specified through a variable called "OSAL_USER_C_FLAGS". The value of this variable is set in one of two ways:
In all cases, a CMake cache variable is utilized so that value will be retained from build to build, even if the original environment variable changes. This is important for building from an IDE that may have a different environment than the command shell. Also, the {{{-Wall}}} build option is added to all builds. |
Trac comment by glimes on 2015-05-18 20:04:56: Accept. |
Trac comment by sstrege on 2015-05-19 10:38:17: What is the mechanism by which developers can easily add extra CFLAGS to a build using the old build system? |
Trac comment by sstrege on 2015-06-29 16:53:27: The answer to my question above is provided in the comments (through an environment variable). |
Trac comment by sstrege on 2015-06-29 16:53:39: Accept |
Trac comment by glimes on 2015-06-30 11:02:42: Recommend accept. |
Trac comment by acudmore on 2015-06-30 12:40:43: Recommend accept. |
Trac comment by glimes on 2015-06-30 14:37:42: CCB approved. |
It has become apparent that a "one-size-fits-all" approach to compiler warnings may not be sufficient going forward.
In general, most developers should be using "-Werror" in addition to "-Wall", "-pendantic", etc to catch any coding issues at first sight.
However, the specific set of warnings for any given piece of code is dependent on the specific compiler version, target architectures, and optimization level in use at the time of build. This can mean code that builds without warnings on one build can fail miserably on a different build.
This could be an major issue for a novice who clones the latest code from the community repository, and builds it with the latest version of GCC (i.e. one that we may not have tested yet) and finds a new warning that causes the entire build to fail unexpectedly.
As a compromise, the following is proposed:
The automatic builds done by Bamboo, these will be built without "-Werror" but the build log will be checked for warnings, and the presence of any new warnings will be logged as a unit test error so they can be fixed before moving the code forward.
The text was updated successfully, but these errors were encountered: