<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 6, 2011, at 10:21 AM, Ahmed Charles wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta content="text/html; charset=windows-1252" http-equiv="Content-Type"><div><div><div style="font-family: Calibri,sans-serif; font-size: 11pt;">I'm looking into adding flags for the various warnings without them and was wondering what the bar is in terms of test cases? It seems like existing flags don't have explicit test cases and in some cases neither do the warnings.<br>
</div></div></div>
</blockquote></div><div><br></div><div>Good questions. These are two separate issues. It's simply bad that we have warnings that aren't being tested at all (behaviorally). For those we should continue to add test cases to improve our coverage of the compiler's behavior.</div><div><br></div><div>For testing coverage of warning flags, the only thing you could really test from a behavior perspective is whether passing -W/-Wno<warning> enables/disables the warning (or use pragmas that accomplish the same thing). Many warnings are on by default, so many of the tests would need to go for the "disable warning" route. We are pretty confident that the general warning suppression/enabling mechanism works (it is well tested), so we only really need to add specific tests like these for warnings where it is clear we want to tease out some warning from a larger class of warnings and have the ability to disable it (e.g., a user explicitly requested this functionality).</div><div><br></div><div>So, for testing whether or not a warning has a flag, we have test/Misc/warning-flags.c. Essentially we run diagtool to list all the warnings that are not covered by a flag. Whenever a warning that was previously not covered by a flag gets a flag, this test needs to be updated (i.e., remove the entry). That's usually sufficient in my opinion to test that a warning is covered by a flag.</div></body></html>