This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libcpp+C++ PATCH] Fix -Wempty-body C++ warning (PR c++/36478)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Nov 2008 11:33:26 -0800
- Subject: Re: [libcpp+C++ PATCH] Fix -Wempty-body C++ warning (PR c++/36478)
- References: <20081110133714.GQ3572@tyan-ft48-01.lab.bos.redhat.com>
>From a technical perspective, I think this patch makes sense. In
particular, using a flag from the preprocessor, rather than poking at
location information, seems OK to me.
But, do we really want to warn about:
while (0);
but not:
while (0) ;
?
That seems surprising to me.
I can understand not warning about:
while (0)
;
which seems a more explicit indication that the user has an infinite
loop there.
If we're using the single space as a way of making -save-temps work
(because an empty macro gets replaced with a space), I think that's just
as fragile a hack as we had before. If we really need to make
-save-temps work, then we need -save-temps to emit something explicit to
mark the presence of the macro.
But, I also don't see it as a crisis if -save-temps doesn't work in this
particular case. Once we decide that the presence of a macro is a
significant fact, we also accept that preprocessing the code is going to
result in a change. That might argue that using the presence of a macro
is a mistake...
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713