Enable a new compiler warning, fix any issues that ensue #4BRL-CAD
Status: ClosedTime to complete: 144 hrs Mentors: AndreiTags: C, C++, compilation, warnings

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.

 

Uploaded Work
File name/URLFile sizeDate submitted
enable_flags.patch414 bytesJanuary 05 2014 14:50 UTC
brlcad-new-flags.log437.6 KBJanuary 05 2014 14:51 UTC
libbu-wconvert-bad.patch32.6 KBJanuary 06 2014 02:14 UTC
libbu-wconversion-build.log96.2 KBJanuary 06 2014 02:16 UTC
Comments
Jacob Burroughson January 5 2014 13:57 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on January 5 2014 14:19 UTCTask Assigned

This task has been assigned to Jacob B. You have 144 hours to complete this task, good luck!

Jacob Burroughson January 5 2014 14:52 UTCReady for review

The work on this task is ready to be reviewed.

Jacob Burroughson January 5 2014 16:21 UTCClaim Removed

The claim on this task has been removed, someone else can claim it now.

Jacob Burroughson January 5 2014 16:58 UTCTask Claimed

I would like to work on this task.

Sean on January 5 2014 17:36 UTCTask Assigned

This task has been assigned to Jacob B. You have 144 hours to complete this task, good luck!

Jacob Burroughson January 6 2014 02:17 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 6 2014 02:52 UTCTask Needs More Work

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.

Jacob Burroughson January 6 2014 13:31 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 6 2014 13:55 UTCTask Closed

Congratulations, this task has been completed successfully.