------- Comment #5 from jakub at gcc dot gnu dot org 2008-11-10 10:15 ------- 2 locations won't help you either. void foo () { #define EMPTY while (0)EMPTY; } won't warn when compiled with g++ -Wempty-body -O2, but will with g++ -Wempty-body -O2 -save-temps (i.e. ccache etc.). I think it is unfortunate this -Wempty-body extension was accepted for 4.3, and if we want to make it work, we really have to handle it at the preprocessor level.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36478