Skip to content
Commit e33a02ed authored by Maciej Wieczor-Retman's avatar Maciej Wieczor-Retman Committed by Shuah Khan
Browse files

selftests: Add printf attribute to kselftest prints



Kselftest header defines multiple variadic functions that use printf
along with other logic.

There is no format checking for the variadic functions that use
printing inside kselftest.h. Because of this the compiler won't
be able to catch instances of mismatched printf formats and debugging
tests might be more difficult.

Add the common __printf() attribute macro to kselftest.h.

Add __printf() attribute to every function using formatted printing
with variadic arguments.

Adding the attribute and compiling all selftests exposes a number of
-Wformat warnings which were previously unnoticed due to a lack of
format specifiers checking by the compiler.

Signed-off-by: default avatarMaciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 2531f374
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment