From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f201.google.com ([209.85.223.201]:57067 "EHLO mail-io0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbeG3XLN (ORCPT ); Mon, 30 Jul 2018 19:11:13 -0400 Received: by mail-io0-f201.google.com with SMTP id i13-v6so7020874ioq.23 for ; Mon, 30 Jul 2018 14:34:19 -0700 (PDT) Date: Mon, 30 Jul 2018 14:34:10 -0700 Message-Id: <20180730213412.242849-1-ndesaulniers@google.com> Mime-Version: 1.0 Subject: [PATCH v2 0/2] CLANG_VERSION and __diag macros From: Nick Desaulniers To: akpm@linux-foundation.org, natechancellor@gmail.com Cc: arnd@arndb.de, paul.burton@mips.com, christophe.leroy@c-s.fr, shorne@gmail.com, yamada.masahiro@socionext.com, keescook@chromium.org, mingo@kernel.org, gregkh@linuxfoundation.org, tglx@linutronix.de, rdunlap@infradead.org, bp@suse.de, neilb@suse.com, linux-kernel@vger.kernel.org, aryabinin@virtuozzo.com, dwmw@amazon.co.uk, sandipan@linux.vnet.ibm.com, linux@rasmusvillemoes.dk, paullawrence@google.com, andreyknvl@google.com, will.deacon@arm.com, ghackmann@android.com, stable@vger.kernel.org, ghackmann@google.com, mka@chromium.org, jpoimboe@redhat.com, wvw@google.com, avagin@openvz.org, Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Sender: stable-owner@vger.kernel.org List-ID: 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