[cfe-commits] Warning flags

Ted Kremenek kremenek at apple.com
Fri Oct 7 13:59:55 PDT 2011


Do you have one aggregate patch that will make this easier to review?

On Oct 7, 2011, at 1:53 AM, Ahmed Charles wrote:

> Here is the first few. They have to be applied in order, or the
> changes in the test will conflict. And hopefully the naming is
> appealing enough. :)
> 
> On Thu, Oct 6, 2011 at 2:10 PM, Ahmed Charles <ahmedcharles at gmail.com> wrote:
>> On Thu, Oct 6, 2011 at 1:16 PM, Ted Kremenek <kremenek at apple.com> wrote:
>>> On Oct 6, 2011, at 10:21 AM, Ahmed Charles wrote:
>>> 
>>> 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.
>>> 
>>> 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.
>>> 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).
>>> 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.
>> 
>> Thanks, that's what I thought.
>> 
>> --
>> Ahmed Charles
>> 
> <0003-Place-diagnostic-backslash_newline_space-under-the-W.patch><0004-Place-diagnostics-null_in_string-null_in_char-and-nu.patch><0005-Place-renamed-diagnostic-ext_charize_microsoft-under.patch><0007-Place-diagnostic-ext_dollar_in_identifier-under-the-.patch><0008-Place-diagnostics-ext_c99_array_usage-ext_c99_compou.patch><0009-Place-diagnostic-ext_auto_storage_class-under-the-Wa.patch><0010-Place-diagnostics-ext_catch_incomplete_ref-and-ext_c.patch><0011-Place-diagnostics-ext_flexible_array_in_array-and-ex.patch><0012-Place-diagnostic-warn_delete_incomplete-under-the-Wd.patch><0013-Place-diagnostics-warn_c_kext-warn_drv_assuming_mflo.patch><0014-Place-diagnostics-warn_ucn_escape_too_large-and-warn.patch>




More information about the cfe-commits mailing list