This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Improve -Wc++-compat to warn about types defined inside structs
On Fri, 8 May 2009, Ian Lance Taylor wrote:
> Thanks for pointing that out. I extended the patch to catch types
> defined in sizeof/typeof/alignof and in casts. For sizeof/typeof/
> alignof it will only issue that warning, not the warning about being
> defined in a struct/union.
Since you're including the GNU extensions of typeof and alignof I think
you should also check for types being defined in compound literals (C99
but a GNU extension to C++). The C changes are OK with that added, and
with ...
> One issue I noticed is that gcc itself uses a type defined in a cast, in
> CONST_CAST in system.h. Therefore, I changed __extension__ to disable
> -Wc++-compat. I didn't change the documentation, as by my reading of it
... a testcase added for this disabling.
--
Joseph S. Myers
joseph@codesourcery.com