Re: [PATCH 1/5] add tests for function attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 20, 2019 at 02:05:58AM +0000, Ramsay Jones wrote:
> On 20/11/2019 00:02, Luc Van Oostenryck wrote:
> > Function attributes need to be parsed differently than
> > the usual specifiers. For example, in code like:
> > 	#define __noreturn __attribute__((noreturn))
> > 	__noreturn void foo(int a);
> > the __noreturn attribute should apply to the function type,
> > while a specifier like 'const' would apply to its return type.
> > It's even more clear when function pointers are involved:
> > 	__noreturn void (*fptr)(void);
> > here too, the attribute should be applied to the function type,
> > not the its return type, nor to the declared pointer type.
> 
> Hmm, it _is_ applied to the 'pointed to' type; ie the pointer
> base type. I don't quite know how to say that succinctly (so
> just ignore my rambling! ;-)

Well, yes, in the case with the function pointer, the attribute
should be applied to the 'pointed to' type. But this 'pointed to'
type is the function type and that was what I wanted to emphase.

Best regards,
-- Luc 



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux