This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] warning about empty extern "C" structures
Roman Kononov wrote:
> On 05/17/2006 13:52, Mark Mitchell wrote:
>> Still, I think the warning itself is OK. However, the patch is
>> incomplete, because it is missing invoke.texi documentation. (It would
>> sure be nice to auto-generate that from texinfo fragments in .opt files,
>> but...)
>
> With invoke.texi this time.
>
> 2006-05-17 Roman Kononov <kononov195-qwe@yahoo.com>
>
> New g++ warning about empty extern "C" structures
> * class.c (layout_class_type): Warning added
> * c.opt: -Wempty-c-struct option added
> * invoke.texi: new manual entry
> +Empty structures (structures without non-static data members)
Change:
> have
> +different layouts in G++ and GCC, which may cause undefined run-time
> +behavior when the structures are referenced from both G++ and GCC code.
to:
"have zero size in GNU C, but non-zero size in C++, which may cause
problems when an empty structure is used in both C and C++ code."
Rename:
> +Wempty-c-struct
to Wempty-struct, so that Gaby can easily add a warning to the C front end.
The patch is OK with those changes, but you'll need a copyright
assignment, if you don't already have one, and you'll need to wait for
Stage 1 of GCC 4.3, as this is a new feature, not a bug-fix.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713