This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Proposed semantics for attributes in C++ (and in C?)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Sun, 15 Oct 2006 22:52:08 +0000 (UTC)
- Subject: Re: Proposed semantics for attributes in C++ (and in C?)
- References: <4532B25F.9090207@codesourcery.com>
On Sun, 15 Oct 2006, Mark Mitchell wrote:
> We have a number of C++ PRs open around problems with code like this:
>
> struct S {
> void f();
> virtual void g();
> };
>
> typedef __attribute__((...)) struct S T;
I was happy with the state before r115086 (i.e. with it being documented
that such attributes on typedefs are ignored). But given that we are now
attempting to honour them, the proposed semantics seem reasonable.
The proposal requires documentation for each (type) attribute of whether
it is semantic or non-semantic. In general the documentation of attribute
semantics needs cleaning up to make clear just when each attribute can be
used and what exactly it means (and the code needs cleaning up to follow
sensible documented semantics) - for example, attributes with
documentation split and duplicated because they apply to more than one of
functions, variables and types. (The syntax documentation is cleaner, and
I think accurate for C, but it does include some speculative future
possibilities that seemed nice when I first wrote it but I no longer think
would be a good idea.)
--
Joseph S. Myers
joseph@codesourcery.com