From: Petr Mladek <pmladek@suse.com>
To: Tamir Duberstein <tamird@gmail.com>
Cc: kernel test robot <lkp@intel.com>,
David Gow <davidgow@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <skhan@linuxfoundation.org>,
oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v8 3/4] scanf: convert self-test to KUnit
Date: Wed, 5 Mar 2025 10:47:17 +0100 [thread overview]
Message-ID: <Z8gdpSErMCMCZZNP@pathway.suse.cz> (raw)
In-Reply-To: <CAJ-ks9kkigKG=Nf_mZrA5CA=SUV2sSyY51_rLef42T+ZxCmk1Q@mail.gmail.com>
On Sat 2025-02-15 14:52:22, Tamir Duberstein wrote:
> On Sat, Feb 15, 2025 at 1:51 PM kernel test robot <lkp@intel.com> wrote:
> >
> > Hi Tamir,
> >
> > kernel test robot noticed the following build warnings:
> >
> > [auto build test WARNING on 7b7a883c7f4de1ee5040bd1c32aabaafde54d209]
> >
> > url:
> https://github.com/intel-lab-lkp/linux/commits/Tamir-Duberstein/scanf-implicate-test-line-in-failure-messages/20250215-002302
> > base: 7b7a883c7f4de1ee5040bd1c32aabaafde54d209
> > patch link:
> https://lore.kernel.org/r/20250214-scanf-kunit-convert-v8-3-5ea50f95f83c%40gmail.com
> > patch subject: [PATCH v8 3/4] scanf: convert self-test to KUnit
> > config: sh-randconfig-002-20250216 (
> https://download.01.org/0day-ci/archive/20250216/202502160245.KUrryBJR-lkp@intel.com/config
> )
> > compiler: sh4-linux-gcc (GCC) 14.2.0
> > reproduce (this is a W=1 build): (
> https://download.01.org/0day-ci/archive/20250216/202502160245.KUrryBJR-lkp@intel.com/reproduce
> )
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new
> version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes:
> https://lore.kernel.org/oe-kbuild-all/202502160245.KUrryBJR-lkp@intel.com/
> >
> > All warnings (new ones prefixed by >>):
> >
> > In file included from <command-line>:
> > lib/tests/scanf_kunit.c: In function 'numbers_list_ll':
> > >> include/linux/compiler.h:197:61: warning: function 'numbers_list_ll'
> might be a candidate for 'gnu_scanf' format attribute
> [-Wsuggest-attribute=format]
>
> I am not able to reproduce these warnings with clang 19.1.7. They also
> don't obviously make sense to me.
I have reproduced the problem with gcc:
$> gcc --version
gcc (SUSE Linux) 14.2.1 20250220 [revision 9ffecde121af883b60bbe60d00425036bc873048]
$> make W=1 lib/test_scanf.ko
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CC [M] lib/test_scanf.o
In file included from <command-line>:
lib/test_scanf.c: In function ‘numbers_list_ll’:
./include/linux/compiler.h:197:61: warning: function ‘numbers_list_ll’ might be a candidate for ‘gnu_scanf’ format attribute [-Wsuggest-attribute=format]
197 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
[...]
It seems that it is a regression introduced by the first
patch of this patch set. And the fix is:
diff --git a/lib/test_scanf.c b/lib/test_scanf.c
index d1664e0d0138..e65b10c3dc11 100644
--- a/lib/test_scanf.c
+++ b/lib/test_scanf.c
@@ -27,7 +27,7 @@ static struct rnd_state rnd_state __initdata;
typedef int (*check_fn)(const char *file, const int line, const void *check_data,
const char *string, const char *fmt, int n_args, va_list ap);
-static void __scanf(6, 0) __init
+static void __scanf(6, 8) __init
_test(const char *file, const int line, check_fn fn, const void *check_data, const char *string,
const char *fmt, int n_args, ...)
{
Best Regards,
Petr
next prev parent reply other threads:[~2025-03-05 9:47 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 16:19 [PATCH v8 0/4] scanf: convert self-test to KUnit Tamir Duberstein
2025-02-14 16:19 ` [PATCH v8 1/4] scanf: implicate test line in failure messages Tamir Duberstein
2025-03-05 8:55 ` Petr Mladek
2025-03-05 9:56 ` Petr Mladek
2025-03-05 11:35 ` Tamir Duberstein
2025-02-14 16:19 ` [PATCH v8 2/4] scanf: remove redundant debug logs Tamir Duberstein
2025-03-05 8:59 ` Petr Mladek
2025-02-14 16:20 ` [PATCH v8 3/4] scanf: convert self-test to KUnit Tamir Duberstein
2025-02-15 18:50 ` kernel test robot
2025-02-15 19:52 ` Tamir Duberstein
2025-02-16 20:22 ` Andy Shevchenko
2025-02-17 14:29 ` Tamir Duberstein
2025-03-05 9:47 ` Petr Mladek [this message]
2025-03-05 11:36 ` Tamir Duberstein
2025-03-05 12:46 ` Petr Mladek
2025-02-14 16:20 ` [PATCH v8 4/4] scanf: break kunit into test cases Tamir Duberstein
2025-03-05 15:01 ` Petr Mladek
2025-03-05 15:25 ` Tamir Duberstein
2025-03-05 15:55 ` Andy Shevchenko
2025-03-05 15:57 ` Tamir Duberstein
2025-03-05 19:35 ` Andy Shevchenko
2025-03-05 20:09 ` Tamir Duberstein
2025-03-06 9:38 ` Petr Mladek
2025-03-06 10:56 ` Tamir Duberstein
2025-03-05 15:54 ` Andy Shevchenko
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=Z8gdpSErMCMCZZNP@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=davidgow@google.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=skhan@linuxfoundation.org \
--cc=tamird@gmail.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.