This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]