This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36478] [4.3/4.4 regression] warning not emitted when code expanded from macro
- From: "dodji at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2008 12:22:35 -0000
- Subject: [Bug c++/36478] [4.3/4.4 regression] warning not emitted when code expanded from macro
- References: <bug-36478-360@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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