...
Assuming a conforming implementation, eliminating diagnostic messages will eliminate any syntactic or constraint violations.
If suitable source code–checking -code-checking tools are available, use them regularly.
...
MSC00-EX1: Compilers can produce diagnostic messages for correct code, as is permitted by C [ISO/IEC 9899:2011]. It is usually preferable to rewrite code to eliminate compiler warnings, but if the code is correct, it is sufficient to provide a comment explaining why the warning message does not apply. Some compilers provide ways to suppress warnings, such as suitably formatted comments or pragmas, which can be used sparingly when the programmer understands the implications of the warning but has good reason to use the flagged construct anyway.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
...
...
...
...
Unused variable |
...
...
...
-570, |
...
Expression is always false |
...
...
...
Expression is always true |
...
...
Bibliography
[ |
...
ISO/IEC 9899:2011] | Section 5.1.1.3, "Diagnostics" |
[Seacord |
...
2013] | Chapter |
...
9, "Recommended Practices" | |
[Sutter 2005] | Item 1 |
...