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:
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.
@ngoldbaum 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.
Thanks, @ngoldbaum . I'm traveling right now, but will run the test suite by Thurs. morning. Sorry for the delay!
Hi @ngoldbaum - a quick followup on this. When I run the test suite, more than half of the tests fail:
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: