[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFd5g47bbFdWmGHZQN=P93XPG2Bj=tBgK1W1n=LMFLHdO869gA@mail.gmail.com>
Date: Tue, 15 Jun 2021 14:01:05 -0700
From: Brendan Higgins <brendanhiggins@...gle.com>
To: David Gow <davidgow@...gle.com>
Cc: Shuah Khan <skhan@...uxfoundation.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
KUnit Development <kunit-dev@...glegroups.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kunit: Add gnu_printf specifiers
On Thu, May 13, 2021 at 1:03 PM David Gow <davidgow@...gle.com> wrote:
>
> Some KUnit functions use variable arguments to implement a printf-like
> format string. Use the __printf() attribute to let the compiler warn if
> invalid format strings are passed in.
>
> If the kernel is build with W=1, it complained about the lack of these
> specifiers, e.g.:
> ../lib/kunit/test.c:72:2: warning: function ‘kunit_log_append’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
>
> Signed-off-by: David Gow <davidgow@...gle.com>
Acked-by: Brendan Higgins <brendanhiggins@...gle.com>
Powered by blists - more mailing lists