linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] CLANG_VERSION and __diag macros
@ 2018-07-30 21:34 Nick Desaulniers
  2018-07-30 21:34 ` [PATCH v2 1/2] compiler-clang.h: Add " Nick Desaulniers
  2018-07-30 21:34 ` [PATCH v2 2/2] kernel.h: Disable -Wreturn-stack-address for _THIS_IP_ Nick Desaulniers
  0 siblings, 2 replies; 16+ messages in thread
From: Nick Desaulniers @ 2018-07-30 21:34 UTC (permalink / raw)
  To: akpm, natechancellor
  Cc: arnd, paul.burton, christophe.leroy, shorne, yamada.masahiro,
	keescook, mingo, gregkh, tglx, rdunlap, bp, neilb, linux-kernel,
	aryabinin, dwmw, sandipan, linux, paullawrence, andreyknvl,
	will.deacon, ghackmann, stable, ghackmann, mka, jpoimboe, wvw,
	avagin, Nick Desaulniers

clang-7 has a new warning (-Wreturn-stack-address) for warning when a
function returns the address of a local variable.  This is in general a
good warning, but the kernel has a few places where GNU statement
expressions return the address of a label in order to get the current
instruction pointer (see _THIS_IP_ and current_text_addr).

In order to disable a warning at a single call site, the kernel already
has __diag macros for inserting compiler and compiler-version specific
_Pragma's.

This series adds CLANG_VERSION macros necessary for proper __diag
support, and whitelists the case in _THIS_IP_. current_text_addr will be
consolidated in a follow up series.

Nick Desaulniers (2):
  compiler-clang.h: Add CLANG_VERSION and __diag macros
  kernel.h: Disable -Wreturn-stack-address for _THIS_IP_

 include/linux/compiler-clang.h | 19 +++++++++++++++++++
 include/linux/compiler_types.h |  4 ++++
 include/linux/kernel.h         | 10 +++++++++-
 3 files changed, 32 insertions(+), 1 deletion(-)

-- 
2.18.0.345.g5c9ce644c3-goog


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

end of thread, other threads:[~2018-08-31 22:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30 21:34 [PATCH v2 0/2] CLANG_VERSION and __diag macros Nick Desaulniers
2018-07-30 21:34 ` [PATCH v2 1/2] compiler-clang.h: Add " Nick Desaulniers
2018-07-30 23:25   ` Nathan Chancellor
2018-08-31 21:50   ` Nick Desaulniers
2018-08-31 22:16     ` Miguel Ojeda
2018-07-30 21:34 ` [PATCH v2 2/2] kernel.h: Disable -Wreturn-stack-address for _THIS_IP_ Nick Desaulniers
2018-07-30 23:25   ` Nathan Chancellor
2018-07-31 10:27   ` kbuild test robot
2018-07-31 16:48     ` Nick Desaulniers
2018-07-31 17:02       ` Kees Cook
2018-07-31 17:09         ` Nick Desaulniers
2018-07-31 18:58         ` Nick Desaulniers
2018-07-31 21:10           ` Nick Desaulniers
2018-07-31 17:02       ` Nathan Chancellor
2018-07-31 13:53   ` kbuild test robot
2018-07-31 16:55     ` Nick Desaulniers

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 NNTP newsgroup(s).