This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Attribute questions
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Attribute questions
- From: Richard Henderson <rth at redhat dot com>
- Date: Thu, 28 Jun 2001 22:58:25 -0700
- Cc: gcc at gcc dot gnu dot org
- References: <42600000.993788170@warlock.codesourcery.com>
On Thu, Jun 28, 2001 at 09:16:10PM -0700, Mark Mitchell wrote:
> 1.The manual says that the `unused' attribute applied to functions
> is not supported by G++ "as definitions without parameters are
> valid in C++". This seems confused. The `unused' attribute
> applied to a function means that the function is not used; what,
> if anything, has this to do with its parameters?
Look at the definition of UNUSED in gthr-single.h. I'd actually
like this fixed so that code can be more easily shared between
GNU C and GNU C++.
> 2.Do people really use "prefix attributes"? They are undocumented,
> as far as I can tell. (This is the bit where you fix attributes
> in with the decl-specifier-seq in a declaration, like this:
>
> void __attribute__ ((pure)) f();
>
> Very ugly. I expect we daren't remove these, right?
That's where windows puts its attributes, e.g. __declspec(dllexport).
It's also the only way to put attributes on function definitions,
rather than declarations. E.g.
static void __attribute__((noreturn))
panic(int error_code)
{
...
}
I rather like it, myself.
> 3. The manual contains anti-#pragma rhetoric.
[...]
> Can we just remove this bit of editorialization from the macro?
Please.
r~