1. The Enzo Project
  2. Untitled project
  3. enzo-dev
  4. Pull requests

Pull requests

#321 Merged at 96c80bb
Repository
ngoldbaum
Branch
week-of-code
Repository
enzo
Branch
week-of-code

Fix a number of compiler warnings found by turning on -Werror.

Author
  1. Nathan Goldbaum
Reviewers
Description

This fixes a number of warning messages generated when I compile Enzo with -Werror. A lot of these are innocuous and have to do with ambiguous control flow when using if/else blocks without braces, but a decent fraction look to me like real bugs. Hopefully this will also be useful to others who want to detect bugs using -Werror in new code but don't want to wade through the large number of existing compiler warnings in Enzo.

For the record, I'm using the following compiler flags:

-Werror -Wno-c++11-compat-deprecated-writable-strings -Wno-format -Wno-deprecated-declarations -Wno-implicit-function-declaration -Wno-undefined-inline

I whitelisted some warnings because they would generate a large number of innocuous false positives or because I don't understand how to fix the issues indicated by the warnings.

Comments (11)

  1. John Wise

    Nathan Goldbaum This is all great! Thanks for going through the entire code and fixing these things. I looked through all of your changes, and there were indeed some actual bugs that were caught with these warning flags.

    Once it passes the test suite, I will approve.

    1. Brian O'shea

      Hi Nathan Goldbaum - a quick followup on this. When I run the test suite, more than half of the tests fail:

      FAILED (errors=21)
      Testing complete.
      Sims not finishing: 0
      Number of errors: 964
      Number of failures: 0
      Number of successes: 891
      

      These are not simple differences in values - many of the tests are failing outright. Did you run the test suite prior to issuing the PR? And, if so, did you see anything like this? The errors I'm seeing are:

      http://galactica.pa.msu.edu/~bwoshea/misc/test_suite_errors_PR321.log