This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
What to do with the transparent_union attribute
- From: Steven Bosscher <stevenb at suse dot de>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 24 Jan 2005 15:08:01 +0100
- Subject: What to do with the transparent_union attribute
- Organization: SUSE Labs
Hi,
While browsing tree.h I noticed DECL_TRANSPARENT_UNION, and I didn't
know what it was so I grepped for it a bit.
The only users are function.c and c-common.c, to handle an attribute
called `transparent_union'. The purpose of the attribute is to
change the argument passing conventions for objects of the type of
the union. Instead of the normal union argument passing conventions,
unions with the `transparent_union' attribute are passed as if the
object has the type of the first field of the union.
Apart from being a dangerous attribute, it also seems this attribute
has no test cases in the test suite. The only test that uses the
attribute is gcc.c-torture/compile/960201-1.c, but that test doesn't
check if the attribute has the desired effect.
Furthermore, the attribute has not had any modifications to it since
1996 ("Fri Feb 16 20:13:23 1996 Paul Eggert <eggert@twinsun.com>"),
the only other changes to the related flags and checks were to add
tree checking, table driven attribute handling, and pretty printing.
So I was thinking, should we keep this attribute, or can it perhaps
be deprecated for GCC 4.0 and removed in 4.1? Or is this attribute
still useful?
Gr.
Steven