From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 587B8C433E7 for ; Mon, 12 Oct 2020 01:01:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F4442074D for ; Mon, 12 Oct 2020 01:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602464465; bh=2M33F9OOhfCSo07h9W2ctFZb0Br9l/+3Io/44dnCOKo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=RTaQsPrwQ5eaqidl4w9cGyepWYgIic3Yd7OO1Xbg4So7FjvhTEmG6ST8oxNHBxmIl bGPjbfhIZ651nD0G4TxYYHHddIMr7hVGzeMYQE5jeM/aI4VG10kWdqtiHobflYAx0Z D4SK6M05+oIwiTph+njnkkmQiWU1lM4dtg1StnyM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727245AbgJLBBE (ORCPT ); Sun, 11 Oct 2020 21:01:04 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:34510 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727132AbgJLBBE (ORCPT ); Sun, 11 Oct 2020 21:01:04 -0400 X-Greylist: delayed 42977 seconds by postgrey-1.27 at vger.kernel.org; Sun, 11 Oct 2020 21:01:03 EDT Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 09C10eZ7007021; Mon, 12 Oct 2020 10:00:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 09C10eZ7007021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1602464440; bh=o9Qs2wdvNnlhb5S1PCEmTwni8pcS98p2JBGMsac1Ols=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=209KxBvOeyWGBAgIaf8EJSaA7Yc6qPdkUWqxBZfme+MoVIUE0vOKcNlyPgdX5DlIr vbLFyCIz9n7AKNWcQ6RlA2ySvMN0NrRU9Ve+S2wESH+0UJ6YIOg3a5trDNx2vZ/1pI z84ss89OHA8kHCXaZ9ISK+H6aSQgA/mv4fH6okq2lE3qcmwvlbwrDLcbraMHtegnIE nED3WJT1jO+YHrQALMOTIJ5aRCUXTD6OErHtD/0x6Tcjhd98MZlJBJREBJlblPgU5g 3wyjrQVooB715wrwb6TFhZQL1qFRkhHZr0j6nRiVHK1Dy1bl09a1C49dCv4P/T7JyQ uJ6B7PolLL0Eg== X-Nifty-SrcIP: [209.85.215.179] Received: by mail-pg1-f179.google.com with SMTP id n9so12672476pgf.9; Sun, 11 Oct 2020 18:00:40 -0700 (PDT) X-Gm-Message-State: AOAM531lndw6tBZMW2yewP62hiyb0CQvT8uUqEucVLzoY4H5VGd6pdrt +vgaj/0hLlL57esSXXNfuEMIQmGwCQrYoZiYmTM= X-Google-Smtp-Source: ABdhPJyZ58mFtSdXnHUPO1e6eNn6ErK26DE/1lnT5+qAHLnpRPX0RJdVCGR/jjW710NGg+xdjyvNDR4Vt/oO3MWwNTU= X-Received: by 2002:a63:d242:: with SMTP id t2mr11790829pgi.47.1602464439492; Sun, 11 Oct 2020 18:00:39 -0700 (PDT) MIME-Version: 1.0 References: <20201001011232.4050282-1-andrew@lunn.ch> <20201001011232.4050282-2-andrew@lunn.ch> <20201002014411.GG4067422@lunn.ch> In-Reply-To: From: Masahiro Yamada Date: Mon, 12 Oct 2020 10:00:02 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v2 1/2] Makefile.extrawarn: Add symbol for W=1 warnings for today To: Arnd Bergmann Cc: Andrew Lunn , Nick Desaulniers , netdev , David Miller , Jakub Kicinski , Michal Marek , Rohit Maheshwari , Linux Kbuild mailing list , clang-built-linux Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org On Fri, Oct 2, 2020 at 9:21 PM Arnd Bergmann wrote: > > I do care about the tree as a whole, and I'm particularly interested in > having -Wmissing-declarations/-Wmissing-prototypes enabled globally > at some point in the future. > > Arnd BTW, if possible, please educate me about the difference between -Wmissing-declarations and -Wmissing-prototypes. The GCC manual says as follows: -Wmissing-prototypes (C and Objective-C only) Warn if a global function is defined without a previous prototype declaration. This warning is issued even if the definition itself provides a prototype. Use this option to detect global functions that do not have a matching prototype declaration in a header file. This option is not valid for C++ because all function declarations provide prototypes and a non-matching declaration declares an overload rather than conflict with an earlier declaration. Use -Wmissing-declarations to detect missing declarations in C++. -Wmissing-declarations Warn if a global function is defined without a previous declaration. Do so even if the definition itself provides a prototype. Use this option to detect global functions that are not declared in header files. In C, no warnings are issued for functions with previous non-prototype declarations; use -Wmissing-prototypes to detect missing prototypes. In C++, no warnings are issued for function templates, or for inline functions, or for functions in anonymous namespaces. The difference is still unclear to me... For example, if I add -Wmissing-declarations, I get the following: kernel/sched/core.c:2380:6: warning: no previous declaration for =E2=80=98sched_set_stop_task=E2=80=99 [-Wmissing-declarations] 2380 | void sched_set_stop_task(int cpu, struct task_struct *stop) | ^~~~~~~~~~~~~~~~~~~ But, if I add both -Wmissing-declarations and -Wmissing-prototypes, -Wmissing-declarations is superseded by -Wmissing-prototypes. kernel/sched/core.c:2380:6: warning: no previous prototype for =E2=80=98sched_set_stop_task=E2=80=99 [-Wmissing-prototypes] 2380 | void sched_set_stop_task(int cpu, struct task_struct *stop) | ^~~~~~~~~~~~~~~~~~~ Do we need to specify both in W=3D1 ? If yes, what is the difference between them? -- Best Regards Masahiro Yamada