This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-in-cxx update
2009/4/29 Joseph S. Myers <joseph@codesourcery.com>:
> On Wed, 29 Apr 2009, Manuel López-Ibáñez wrote:
>
> I don't know the rationale for this warning. ?Is it to do with the C++0x
> specification that certain loops may be assumed to terminate?
I guess the rationale is that there is little use for while(true) ;
so it is probably an unintended mistake. I think in this trivial case
we should warn always (in C and C++), whitespace or not (it may come
from a strange macro expansion).
>>
>> BTW, why is this warned about?
>
> I imagine because in C it is not conventional to use "extern" when
> defining something, only on a declaration that is not a definition.
But may it lead to some confusion or subtle error? It seems overly
pedantic to me if it is just a matter of style, because extern is
implicit if missing,
If one wants to use the same code in C and C++, then it is definitely
a spurious warning in my opinion.
Cheers,
Manuel.