[Bug c++/52961] Missing warning on empty if

xinliangli at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 12 23:11:00 GMT 2012


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

--- Comment #3 from davidxl <xinliangli at gmail dot com> 2012-04-12 23:11:10 UTC ---
(In reply to comment #2)
> Yes, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36478 .

thanks. I tried -Wempty-body, gcc gives warning as expected:


emptyif.cpp: In function 'int test(int)':
emptyif.cpp:2:15: warning: suggest braces around empty body in an 'if'
statement [-Wempty-body]
    if (i > 42);



More information about the Gcc-bugs mailing list