many code warnings for WW3 #1166
Replies: 1 comment 1 reply
-
@edwardhartnett I think a lot of these warnings (certainly those regarding unused variables, labels, etc) are due to the prodigious use of I think remedying the issue is a bit of a double-edge sword: adding lots more That's not to say that I don't agree with your "no compiler warnings" ethos - I think that is definitely something we should strive to achieve! It's just that this does come with a downside! Note: Obviously, some of the warnings can (and should) be fixed, such as the precision conversion ones... |
Beta Was this translation helpful? Give feedback.
-
When I compile WW3 I get many many warnings. For example:
Many of these warnings would be very easy to clear.
Ignoring code warnings is extremely counter-productive. Some of the 100+ warnings may indicate real bugs, but that cannot be seen because of all of the simple warnings that have not been cleared up. So we probably have bugs in the code, and the compiler is telling us about them, but we are ignoring that. What a waste, because finding a bug is the most expensive part of maintenance, and the most expensive part of programming. So when the compiler is telling us about problems, and we just ignore it, it's really wasteful.
NCO has a rule, only sporadically enforced, that there should be no compile warnings in operational code. It's a great rule and they should enforce it strictly, IMO. We have turned on warnings checks in the CI of the NCEPLIBS, so that no code which causes warnings (for GNU, with -Wall) can be merged. Clearing up all the warnings in the code left by careless programmers over the years didn't take long.
Allowing warnings in your code is like allowing litter on your street. Not only does it look bad, but it also gives permission for everyone else to litter on your street. (See the broken windows theory.) In WW3, you are giving permission for every programmer to check in code full of warnings.
Wouldn't the software benefit, programmers be more productive, and the science possibly more accurate if the code compiled cleanly, without warning?
Beta Was this translation helpful? Give feedback.
All reactions