BRL-CAD's sources are compiled with a number of build flags including numerous warning flags. By default, we treat all warnings as errors and we turn on nearly every warning that the compiler is capable of producing and then we fix them. When you do this systematically and consistently, it can greatly improve code quality. Help us improve BRL-CAD's code quality even more. We already compile with the following gcc/clang warning flags:
-pedantic -Wall -Wextra -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long -Wno-variadic-macros -Werror
This task involves enabling any new warning flag that is not already explicitly enabled or enabled by default, and then fixing the warnings that result.
Post a patch for review that enables the new flag, fixes at least one warning, and post a full build log (with "make -k" so we can get an estimate of how many issues need to be fixed).
You can enable the build flag by adding a CHECK_C_FLAG(your_flag_here) line in:
- misc/CMake/BRLCAD_CompilerFlags.cmake
Add your line after the "Wall" checks (search for Wall) similar to the numerous other flags being tested. Don't worry about setting it as a C++/CXX flag unless you're feeling adventurous. See the GCC or Clang manual page for a list of warning flags that can be enabled but some unconfirmed possibilities include:
- Wcast-qual
- Wredundant-decls
- Wunreachable-code
- Wmissing-declarations
- Wmissing-prototypes
- Wstrict-prototypes
- Wdocumentation (for Doxygen comments)
- Wfour-char-constants
- Wtraditional
- Wbad-function-cast
- Wc++-compat
- ... many many others ... really, see the GCC manpage and try enabling one
How to approach this task? Add your flag, make sure the build halts because something was detected, then run "make -k" to see just how many were detected. Then try to fix just one of them. If you are successful fixing one of them, submit your make -k log and a patch that fixes one and turns on the flag and get started on fixing the rest.
You'll be expected to fix some portion of the warnings reported, but this will be determined on a case-by-case basis depending on how complicated the warnings are and how many there are.
File name/URL | File size | Date submitted | |
---|---|---|---|
enable_flags.patch | 414 bytes | January 05 2014 14:50 UTC | |
brlcad-new-flags.log | 437.6 KB | January 05 2014 14:51 UTC | |
libbu-wconvert-bad.patch | 32.6 KB | January 06 2014 02:14 UTC | |
libbu-wconversion-build.log | 96.2 KB | January 06 2014 02:16 UTC |
I would like to work on this task.
This task has been assigned to Jacob B. You have 144 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
The claim on this task has been removed, someone else can claim it now.
I would like to work on this task.
This task has been assigned to Jacob B. You have 144 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.
The work on this task is ready to be reviewed.
Congratulations, this task has been completed successfully.