All of lore.kernel.org
 help / color / mirror / Atom feed
From: Youngmin Nam <youngmin.nam@samsung.com>
To: masahiroy@kernel.org, michal.lkml@markovi.net, ndesaulniers@google.com
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	hosung0.kim@samsung.com, d7271.choe@samsung.com,
	Youngmin Nam <youngmin.nam@samsung.com>
Subject: [PATCH] Makefile.extrawarn: add -Wformat-insufficient-args for clang build
Date: Sat, 16 Jul 2022 17:45:32 +0900	[thread overview]
Message-ID: <20220716084532.2324050-1-youngmin.nam@samsung.com> (raw)
In-Reply-To: CGME20220716081736epcas2p346100e67cf44b1dbb79f6e2a4ab07dbf@epcas2p3.samsung.com

The -Wformat-insufficient-args for clang is useful to detect the situation
when the total number is unmatched between format specifiers and arguments.

Originally, this option is enabled by default(Link[1]), but it is disabled by
-Wno-format explicitly so that we can't detect this unmatched situation.

We can enable it by adding this option after -Wno-format.

Link[1]: https://releases.llvm.org/13.0.0/tools/clang/docs/DiagnosticsReference.html#wformat-insufficient-args
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
---
 scripts/Makefile.extrawarn | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index f5f0d6f09053..c23d7c286bad 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -48,6 +48,7 @@ else
 ifdef CONFIG_CC_IS_CLANG
 KBUILD_CFLAGS += -Wno-initializer-overrides
 KBUILD_CFLAGS += -Wno-format
+KBUILD_CFLAGS += -Wformat-insufficient-args
 KBUILD_CFLAGS += -Wno-sign-compare
 KBUILD_CFLAGS += -Wno-format-zero-length
 KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
-- 
2.34.0


       reply	other threads:[~2022-07-16  8:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220716081736epcas2p346100e67cf44b1dbb79f6e2a4ab07dbf@epcas2p3.samsung.com>
2022-07-16  8:45 ` Youngmin Nam [this message]
2022-07-22  4:20   ` [PATCH] Makefile.extrawarn: add -Wformat-insufficient-args for clang build Masahiro Yamada
2022-08-19 23:33     ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220716084532.2324050-1-youngmin.nam@samsung.com \
    --to=youngmin.nam@samsung.com \
    --cc=d7271.choe@samsung.com \
    --cc=hosung0.kim@samsung.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.