4 ms·
It depends on your definition of dangerous. And eliminating false positives in warnings is hugely important. Too many important warnings (more important than t
by jjnoakes 9y ago
It depends on your definition of dangerous.
And eliminating false positives in warnings is hugely important. Too many important warnings (more important than this one) are ignored today because people get desensitized as a result of so many false positives. Let's not add more for trivial issues like this please.
- kazinator 9y agoWarnings are ignored because people don't use -Werror and then fine tune which warnings warnings they want and don't want to see.
- jjnoakes 9y agoWarnings are ignored because it's too hard or not possible to configure the compiler to only issue the warnings a particular developer finds useful and actionable. Adding more warnings, especially for silly corner cases like the example we're discussing, is not the solution.
- kazinator 9y ago> Warnings are ignored because it's too hard or not possible to configure the compiler to only issue the warnings a particular developer finds useful and actionable. That's why you don't do that based on the whims of an individual developer. Simply have a "no warnings" policy. Then the project decides what is enabled and what isn't. A commit must not introduce warnings. If a code change triggers a warning, it must be accompanied with a disabling of that diagnostic, which must then pass review so that it is peer approved. If the warning cannot be disabled, the change must be reworked. This "silly corner case" is not silly at all; it reveals a dangerous translation strategy in the compiler. The appropriate treatment isn't the issuance of a warning; rather, this translation strategy should be turned off unless explicitly requested by an exotic code generation option. (And then it can be applied without any warning.)
- jjnoakes 9y agoIf your warnings policy isn't useful for developers it isn't a good policy. And the translation strategy understand discussion here isn't dangerous.