[PATCH 0/5] fix propagation of function attributes

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

 



Function attributes need to be propagated differently
than the usual specifiers: For example, in code like:
	#define __noreturn __attribute__((noreturn))
	__noreturn void foo(int a);
the __noreturn attribute should be applied to the function
type while a specifier like 'const' would be applied to its
return type. Also, when declaring the corresponding
function pointer or functionpointer pointer:
	__noreturn void (*fptr)(int);
	__noreturn void (**fptr)(int);
the attribute should also be applied to the function type,
not one of the pointer types.
 
This series fixes (hopefully) the previous attempt to solve
this problem. The main patch is #4, pacthes #2 & #3 are
kinda related preparatory patches and patch #5 is clearly
related but independent (and a bit discutable, so will
probably be omitted when pushed to kernel.org).

Many thanks to Ramsay Jones for noticing the problem!


Luc Van Oostenryck (5):
  add tests for function attributes
  fix assignment: pointer to __pure/__noreturn function to void *
  fix assignment check with function attribute
  propagate function modifiers only to functions
  allow omitted function attribute in definition

 evaluate.c                               | 14 +++++--
 parse.c                                  | 49 +++++++++++++-----------
 symbol.h                                 |  5 ++-
 validation/attr-visible.c                | 13 +++++++
 validation/attr-visible2.c               | 10 +++++
 validation/bitwise-function-pointer.c    | 17 ++++++++
 validation/function-attribute-inner.c    |  9 +++++
 validation/function-attribute-omitted.c  | 13 +++++++
 validation/function-attribute-pointer.c  | 33 ++++++++++++++++
 validation/function-attribute-void-ptr.c | 14 +++++++
 validation/function-attribute.c          | 15 +++++---
 validation/function-redecl2.c            |  3 --
 validation/pure-function.c               | 17 ++++++--
 13 files changed, 171 insertions(+), 41 deletions(-)
 create mode 100644 validation/attr-visible.c
 create mode 100644 validation/attr-visible2.c
 create mode 100644 validation/bitwise-function-pointer.c
 create mode 100644 validation/function-attribute-inner.c
 create mode 100644 validation/function-attribute-omitted.c
 create mode 100644 validation/function-attribute-pointer.c
 create mode 100644 validation/function-attribute-void-ptr.c

-- 
2.24.0




[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