On Wed, 29 Apr 2009, Manuel López-Ibáñez wrote:

> 2009/4/29 Joseph S. Myers <jos...@codesourcery.com>:
> > On Wed, 29 Apr 2009, Ian Lance Taylor wrote:
> >
> >> * The C++ frontend warns about "while (true);" when there is no
> >>   whitespace between the ')' and the ';'.  The C frontend does not.  I'm
> >>   not sure how to best handle this.  It doesn't make much sense to warn
> >>   about this with -Wc++-compat.  Should the C frontend warn about this?
> >>   Should the C++ frontend not warn about this?  Any opinions?
> >
> > I consider this whitespace-sensitive warning very dubious.
> 
> So would you like it if it were not sensitive to whitespace?
> (It could be silenced by while(true) (void)0;)
> 
> I think the point is more whether the warning itself is useful or not.

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 see the current code already handles this somehow:
> 
>           /* It is fine to have 'extern const' when compiling at C
>               and C++ intersection.  */
>            if (!(warn_cxx_compat && constp))
>              warning (0, "%qs initialized and declared %<extern%>", name);
> 
> 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.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to