public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc __attribute__
@ 2020-08-06 15:15 Philip R Brenan
  2020-08-06 15:39 ` Marek Polacek
  0 siblings, 1 reply; 2+ messages in thread
From: Philip R Brenan @ 2020-08-06 15:15 UTC (permalink / raw)
  To: gcc

Hi *GCC*:

On page:

https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html

you show the attribute coming after the parameter list.  But when I try
this, I  get the following:

#include <stdlib.h>

void __attribute__ ((noreturn)) aaa()  // OK
 {exit(0);
 }

void bbb() __attribute__ ((noreturn))  // *error*: attributes should be
specified before the declarator in a function definition
 {exit(0);
 }

-- 
Thanks,

Phil <https://metacpan.org/author/PRBRENAN>

Philip R Brenan <https://metacpan.org/author/PRBRENAN>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcc __attribute__
  2020-08-06 15:15 gcc __attribute__ Philip R Brenan
@ 2020-08-06 15:39 ` Marek Polacek
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Polacek @ 2020-08-06 15:39 UTC (permalink / raw)
  To: Philip R Brenan; +Cc: gcc

On Thu, Aug 06, 2020 at 04:15:10PM +0100, Philip R Brenan via Gcc wrote:
> Hi *GCC*:
> 
> On page:
> 
> https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html
> 
> you show the attribute coming after the parameter list.  But when I try
> this, I  get the following:

That manual is for version 3.2, which is ancient.  See
https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Attribute-Syntax.html#Attribute-Syntax

Marek


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-06 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 15:15 gcc __attribute__ Philip R Brenan
2020-08-06 15:39 ` Marek Polacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).