Patch for bug 23113

Joseph S. Myers joseph@codesourcery.com
Fri Aug 5 15:34:00 GMT 2005


On Fri, 5 Aug 2005, Tom Truscott wrote:

> The patch catches the missed important things,
> but I think it warns about too much.
> Here are common macro expansions for which I would prefer no warning:

The patch avoids warning for macro expansions found in GCC itself.  In 
general the problem is that the same code might not be a macro expansion, 
in which case the warning is wanted.  There is an escape provided in the 
form of not warning for statement expressions, so macros can be defined to 
avoid the warning.  Although in such cases of heuristics documenting the 
precise details of what is not warned for is probably inappropriate, it 
may be necessary to update the documentation to mention this escape.

> Aside: testsuite/gcc.dg/Wunused-value-1.c contains code 
> for which warnings are presumably unwanted.
> Should there be "dg-bogus" for those lines?  Or is that unnecessary?

There is no need for dg-bogus unless you wish to XFAIL such a test that 
there are no warnings on a given line, the "test for excess errors" 
suffices otherwise.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc-patches mailing list