]> Git Repo - linux.git/commit
kunit: Annotate _MSG assertion variants with gnu printf specifiers
authorDavid Gow <[email protected]>
Wed, 21 Feb 2024 09:27:22 +0000 (17:27 +0800)
committerShuah Khan <[email protected]>
Wed, 28 Feb 2024 20:07:49 +0000 (13:07 -0700)
commit806cb2270237ce2ec672a407d66cee17a07d3aa2
treef04b1a7d23c107451f7544f37e4b6e7283c760b0
parentfc9a615200d48e076af58f4309f507e500ed900d
kunit: Annotate _MSG assertion variants with gnu printf specifiers

KUnit's assertion macros have variants which accept a printf format
string, to allow tests to specify a more detailed message on failure.
These (and the related KUNIT_FAIL() macro) ultimately wrap the
__kunit_do_failed_assertion() function, which accepted a printf format
specifier, but did not have the __printf attribute, so gcc couldn't warn
on incorrect agruments.

It turns out there were quite a few tests with such incorrect arguments.

Add the __printf() specifier now that we've fixed these errors, to
prevent them from recurring.

Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: David Gow <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Reviewed-by: Justin Stitt <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
include/kunit/test.h
This page took 0.059488 seconds and 4 git commands to generate.