This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/36478] [4.3/4.4 regression] warning not emitted when code expanded from macro



------- Comment #2 from dodji at gcc dot gnu dot org  2008-07-31 12:22 -------
Created an attachment (id=15984)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15984&action=view)
candidate partial fix

This patch fixes the problem patially.

if you have:
------------
void  
foo ()
{
#define WARNS while(0)
#define DOES_NOT_WARN while(0); 
        WARNS; // { dg-warning }
        DOES_NOT_WARN;
            while (0); // { dg-warning }
}
---------------

The compiler (augmented with the patch) says:
/home/dodji/devel/src/gcc-bug-test.cc:6: warning: suggest a space before ?;? or
explicit braces around empty body in ?while? statement
/home/dodji/devel/src/gcc-bug-test.cc:8: warning: suggest a space before ?;? or
explicit braces around empty body in ?while? statement


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36478


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]