Message ID | 20221116182634.2823136-1-sam@gentoo.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4428wrr; Wed, 16 Nov 2022 10:42:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf54ICzZu8MKudrJV1DbOHrMmnPsVysVDrUk8SwK2/1bWmWiasUFDOPagvzK5OU9tJLrxeCB X-Received: by 2002:a17:906:e2c4:b0:7ad:dfb5:a3f2 with SMTP id gr4-20020a170906e2c400b007addfb5a3f2mr18457106ejb.351.1668624171396; Wed, 16 Nov 2022 10:42:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668624171; cv=none; d=google.com; s=arc-20160816; b=ygKn25SsjC7CxaiGB3DCHY3POdZR33MU6WWl97ddPArKzTL5VgXzLRhaWOn/WYs2Xn eqA2jwcTWgnwBoiRZ/TL36zi0ZViDn3Ftrl2kB2XMLRVCpX/y4SstFH4MTmHkjwm6ggN PyBnBi+Td4UopYOu1WgBxMOY6Cp5+w99lYqkz75cfAfvn+tr9mU+5/VxOtCNWLcCoWnY KsIvrOjQrX6GPLkWecmn/uv3RA4/Wk02YVZKIbC2ruB3ZkjWis5QJUcNBKSXGYzy6+Kg 7W9TMMdrS+hcLxd9Y4VRoLCDe8vZTj5VIh5MJlfoEA0gvlSXch4C70jhSbKXw4wNcsqo 00hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=epFo7L3UgcjvhFsf243BM2pRpa53vJmcYthstCzWczo=; b=ZNfE/4ITDlxY2JlwdOh8fGVCei7Ty66cL7iHyd2NEWjsf0tdYWQ72lkx5dauPMIpMg 3lthS9oNRIntbsCQW1OUT36ULb+LZNIi+dNep8rwGp1EbtOp1++gKRCRJ3PTGurZNEaa /GCprdjliM0Dvr/FzCgoMiVnB2flFUC4NROzasrnb8MzI3cKRT59lIGRzMJC0evvSYcs gfxElMIM5M/ZowB/8nMIeZTsJaU81v3rQ8tE48tW22Fnkz3zt+WFMKZJ0mMI5Fvwh2w0 rkwDWOl9AScZB+aAzKZaOZrueIIo4foZrOuPbNhEWvokvviU7tsy9+NbP+ZfWQJjIyKa Z9Cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v30-20020a50d09e000000b0046184b7c4besi12944401edd.462.2022.11.16.10.42.27; Wed, 16 Nov 2022 10:42:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239149AbiKPS0v (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 13:26:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbiKPS0r (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 13:26:47 -0500 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C19A2A246; Wed, 16 Nov 2022 10:26:46 -0800 (PST) From: Sam James <sam@gentoo.org> To: linux-kernel@vger.kernel.org Cc: Sam James <sam@gentoo.org>, Andrew Morton <akpm@linux-foundation.org>, trivial@kernel.org, stable@vger.kernel.org Subject: [PATCH] kbuild: Fix -Wimplicit-function-declaration in license_is_gpl_compatible Date: Wed, 16 Nov 2022 18:26:34 +0000 Message-Id: <20221116182634.2823136-1-sam@gentoo.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749679258792987703?= X-GMAIL-MSGID: =?utf-8?q?1749679258792987703?= |
Series |
kbuild: Fix -Wimplicit-function-declaration in license_is_gpl_compatible
|
|
Commit Message
Sam James
Nov. 16, 2022, 6:26 p.m. UTC
Add missing <string.h> include for strcmp.
Clang 16 makes -Wimplicit-function-declaration an error by default. Unfortunately,
out of tree modules may use this in configure scripts, which means failure
might cause silent miscompilation or misconfiguration.
For more information, see LWN.net [0] or LLVM's Discourse [1], gentoo-dev@ [2],
or the (new) c-std-porting mailing list [3].
[0] https://lwn.net/Articles/913505/
[1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
[2] https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
[3] hosted at lists.linux.dev.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: trivial@kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Sam James <sam@gentoo.org>
---
include/linux/license.h | 2 ++
1 file changed, 2 insertions(+)
Comments
> On 16 Nov 2022, at 18:26, Sam James <sam@gentoo.org> wrote: > > Add missing <string.h> include for strcmp. > > Clang 16 makes -Wimplicit-function-declaration an error by default. Unfortunately, > out of tree modules may use this in configure scripts, which means failure > might cause silent miscompilation or misconfiguration. > > For more information, see LWN.net [0] or LLVM's Discourse [1], gentoo-dev@ [2], > or the (new) c-std-porting mailing list [3]. > > [0] https://lwn.net/Articles/913505/ > [1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213 > [2] https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240 > [3] hosted at lists.linux.dev. > > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: trivial@kernel.org > Cc: stable@vger.kernel.org > Signed-off-by: Sam James <sam@gentoo.org> > --- > include/linux/license.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/license.h b/include/linux/license.h > index 7cce390f120b..1c0f28904ed0 100644 > --- a/include/linux/license.h > +++ b/include/linux/license.h > @@ -2,6 +2,8 @@ > #ifndef __LICENSE_H > #define __LICENSE_H > > +#include <string.h> > + Andrew's added this to his tree with the following fixup (duh!): ``` -#include <string.h> +#include <linux/string.h> ``` Best, sam
Hi Sam, Thank you for the patch! Yet something to improve: [auto build test ERROR on akpm-mm/mm-everything] [also build test ERROR on linus/master v6.1-rc5 next-20221116] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Sam-James/kbuild-Fix-Wimplicit-function-declaration-in-license_is_gpl_compatible/20221117-022718 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20221116182634.2823136-1-sam%40gentoo.org patch subject: [PATCH] kbuild: Fix -Wimplicit-function-declaration in license_is_gpl_compatible config: arc-defconfig compiler: arc-elf-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/f9de22a17ac9a7c6290945983b336296c3d4766b git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Sam-James/kbuild-Fix-Wimplicit-function-declaration-in-license_is_gpl_compatible/20221117-022718 git checkout f9de22a17ac9a7c6290945983b336296c3d4766b # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): In file included from kernel/module/main.c:43: >> include/linux/license.h:5:10: fatal error: string.h: No such file or directory 5 | #include <string.h> | ^~~~~~~~~~ compilation terminated. vim +5 include/linux/license.h 4 > 5 #include <string.h> 6
Hi Sam, Thank you for the patch! Yet something to improve: [auto build test ERROR on akpm-mm/mm-everything] [also build test ERROR on linus/master v6.1-rc5 next-20221116] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Sam-James/kbuild-Fix-Wimplicit-function-declaration-in-license_is_gpl_compatible/20221117-022718 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20221116182634.2823136-1-sam%40gentoo.org patch subject: [PATCH] kbuild: Fix -Wimplicit-function-declaration in license_is_gpl_compatible config: mips-randconfig-r024-20221117 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project bbe6bd724a6335e497c7edaed191d37a828d0390) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install mips cross compiling tool for clang build # apt-get install binutils-mipsel-linux-gnu # https://github.com/intel-lab-lkp/linux/commit/f9de22a17ac9a7c6290945983b336296c3d4766b git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Sam-James/kbuild-Fix-Wimplicit-function-declaration-in-license_is_gpl_compatible/20221117-022718 git checkout f9de22a17ac9a7c6290945983b336296c3d4766b # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash kernel/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): In file included from kernel/bpf/syscall.c:20: >> include/linux/license.h:5:10: error: 'string.h' file not found with <angled> include; use "quotes" instead #include <string.h> ^~~~~~~~~~ "string.h" 1 error generated. vim +5 include/linux/license.h 4 > 5 #include <string.h> 6
diff --git a/include/linux/license.h b/include/linux/license.h index 7cce390f120b..1c0f28904ed0 100644 --- a/include/linux/license.h +++ b/include/linux/license.h @@ -2,6 +2,8 @@ #ifndef __LICENSE_H #define __LICENSE_H +#include <string.h> + static inline int license_is_gpl_compatible(const char *license) { return (strcmp(license, "GPL") == 0