public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Petr Mladek <pmladek@suse.com>
Cc: Justin Stitt <justinstitt@google.com>,
	ndesaulniers@google.com, andriy.shevchenko@linux.intel.com,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
	rostedt@goodmis.org, senozhatsky@chromium.org, trix@redhat.com
Subject: Re: [PATCH v4] lib/test_printf.c: fix clang -Wformat warnings
Date: Wed, 27 Jul 2022 12:39:32 -0700	[thread overview]
Message-ID: <YuGUdHVhfwjobDJP@dev-arch.thelio-3990X> (raw)
In-Reply-To: <Ytag6youpnmli3E1@alley>

Hi Petr,

On Tue, Jul 19, 2022 at 02:17:47PM +0200, Petr Mladek wrote:
> On Mon 2022-07-18 16:06:26, Justin Stitt wrote:
> > see warnings:
> > | lib/test_printf.c:157:52: error: format specifies type 'unsigned char'
> > | but the argument has type 'int' [-Werror,-Wformat]
> > test("0|1|1|128|255",
> > | "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1);
> > -
> > | lib/test_printf.c:158:55: error: format specifies type 'char' but the
> > | argument has type 'int' [-Werror,-Wformat] test("0|1|1|-128|-1",
> > | "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1);
> > -
> > | lib/test_printf.c:159:41: error: format specifies type 'unsigned
> > short'
> > | but the argument has type 'int' [-Werror,-Wformat]
> > | test("2015122420151225", "%ho%ho%#ho", 1037, 5282, -11627);
> > 
> > There's an ongoing movement to eventually enable the -Wformat flag for
> > clang. Previous patches have targeted incorrect usage of
> > format specifiers. In this case, however, the "incorrect" format
> > specifiers are intrinsically part of the test cases. Hence, fixing them
> > would be misaligned with their intended purpose. My proposed fix is to
> > simply disable the warnings so that one day a clean build of the kernel
> > with clang (and -Wformat enabled) would be possible. It would also keep
> > us in the green for alot of the CI bots.
> > 
> > Link: https://github.com/ClangBuiltLinux/linux/issues/378
> > Suggested-by: Nathan Chancellor <nathan@kernel.org>
> > Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> > Signed-off-by: Justin Stitt <justinstitt@google.com>
> 
> Looks good to me:
> 
> Reviewed-by: Petr Mladek <pmladek@suse.com>

Would you be able to take this for 5.20 or should we ask Andrew to pick
it up? It seems you two seem to split applying patches to this file and
we are trying to get -Wformat enabled for clang in 5.20.

Cheers,
Nathan

  reply	other threads:[~2022-07-27 19:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 23:53 [PATCH] lib/test_printf.c: fix clang -Wformat warnings Justin Stitt
2022-06-30  8:13 ` Andy Shevchenko
2022-06-30 17:31   ` Nick Desaulniers
2022-06-30 16:03 ` Nathan Chancellor
2022-06-30 19:57 ` [PATCH v2] " Justin Stitt
2022-06-30 21:42   ` Andy Shevchenko
2022-07-18 17:29 ` [PATCH v3] " Justin Stitt
2022-07-18 22:00   ` Nick Desaulniers
2022-07-18 23:06     ` [PATCH v4] " Justin Stitt
2022-07-19 12:17       ` Petr Mladek
2022-07-27 19:39         ` Nathan Chancellor [this message]
2022-07-28 10:05           ` Petr Mladek
2022-07-19 17:31       ` 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=YuGUdHVhfwjobDJP@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=ndesaulniers@google.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=trix@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox