From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from condef-03.nifty.com (condef-03.nifty.com [202.248.20.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CBEF1FC9 for ; Sat, 3 Sep 2022 18:28:29 +0000 (UTC) Received: from conssluserg-04.nifty.com ([10.126.8.83])by condef-03.nifty.com with ESMTP id 283INMiD005546 for ; Sun, 4 Sep 2022 03:23:22 +0900 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 283IMsWl011246 for ; Sun, 4 Sep 2022 03:22:55 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 283IMsWl011246 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1662229375; bh=Dxm2wQdJj73TakmQEfY+6pG1g4ZOeoTk/i+CCWeCWRE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=g6ANVaL2IxQaEKpn8bW3eCUgMp4EGJuzH1wHH0A+ZmxW/4caNZflWADJibwYud3F2 ophhKsX2aTL5gWJZs4kG5pDpXHNnPoF39sQ1qe7fpTbEKICMEZkfM3Ke9BpD4ScpIC 7vcvftdQEXqiEKY/qG4SgmQAsuMf2EJ4LljkPaWIukixeqZW3lB0D+SfIBKfpHLAsj P1/JCk3t5oS4lgl2S6W7UoLKaPHXxOueK+SqMq1Faiv7i3IhlnhGbe8B5tv2LOy6C+ ogBDucroXrBs4V1Dr7RIBQkl/yneAgVHiB4LLPnIQJP375TetytrkEl5eIJJ65Owjt GxM1H3qqH/kwQ== X-Nifty-SrcIP: [209.85.160.46] Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-11eb44f520dso12580254fac.10 for ; Sat, 03 Sep 2022 11:22:54 -0700 (PDT) X-Gm-Message-State: ACgBeo0OIclzFYMUIivJMxGwcvm/bRYSJPRitbQfHBWbo9IbNkP1J8uP a03aJN3gCRWJBBJDwFfRYrzJDWoAI/Zlsgm7YHg= X-Google-Smtp-Source: AA6agR5XKsnppjDXu4BD9qugd41qLgY6/rMzviOWkZiuaL6QjvVlXtseU4fcnp90Ju6SmXMiKkvZPUbk0DFIfHubSNc= X-Received: by 2002:a05:6870:f626:b0:10d:a798:f3aa with SMTP id ek38-20020a056870f62600b0010da798f3aamr5119106oab.194.1662229373859; Sat, 03 Sep 2022 11:22:53 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220901175913.2183047-1-ndesaulniers@google.com> In-Reply-To: <20220901175913.2183047-1-ndesaulniers@google.com> From: Masahiro Yamada Date: Sun, 4 Sep 2022 03:22:17 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Makefile.extrawarn: re-enable -Wformat for clang; take 2 To: Nick Desaulniers Cc: Linus Torvalds , Joe Perches , Nathan Chancellor , "Sudip Mukherjee (Codethink)" , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , Justin Stitt , Youngmin Nam Content-Type: text/plain; charset="UTF-8" On Fri, Sep 2, 2022 at 2:59 AM Nick Desaulniers wrote: > > -Wformat was recently re-enabled for builds with clang, then quickly > re-disabled, due to concerns stemming from the frequency of default > argument promotion related warning instances. > > commit 258fafcd0683 ("Makefile.extrawarn: re-enable -Wformat for clang") > commit 21f9c8a13bb2 ("Revert "Makefile.extrawarn: re-enable -Wformat for clang"") > > ISO WG14 has ratified N2562 to address default argument promotion > explicitly for printf, as part of the upcoming ISO C2X standard. > > The behavior of clang was changed in clang-16 to not warn for the cited > cases in all language modes. > > Add a version check, so that users of clang-16 now get the full effect > of -Wformat. For older clang versions, re-enable flags under the > -Wformat group that way users still get some useful checks related to > format strings, without noisy default argument promotion warnings. I > intentionally omitted -Wformat-y2k and -Wformat-security from being > re-enabled, which are also part of -Wformat in clang-16. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Link: https://github.com/llvm/llvm-project/issues/57102 > Link: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2562.pdf > Suggested-by: Justin Stitt > Suggested-by: Nathan Chancellor > Suggested-by: Youngmin Nam > Signed-off-by: Nick Desaulniers > --- > Linus, I figured I'd send this to you to see whether you'd prefer to > apply it, or let it "ride the trains" up through the kbuild tree? I do > have another series I'm working on to improve the compiler version > checks > > where I can/will improve the checks used here, but I'm also interested in > having something that might backport cleanly to stable. Linus was addressed, so I just reviewed it. Reviewed-by: Masahiro Yamada -- Best Regards Masahiro Yamada