Re: [PATCH] printf: add __printf attribute

From: kernel test robot

Date: Sat Dec 06 2025 - 20:17:13 EST


Hi Tamir,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 559e608c46553c107dbba19dae0854af7b219400]

url: https://github.com/intel-lab-lkp/linux/commits/Tamir-Duberstein/printf-add-__printf-attribute/20251206-212115
base: 559e608c46553c107dbba19dae0854af7b219400
patch link: https://lore.kernel.org/r/20251206-printf-kunit-printf-attr-v1-1-1682808b51d0%40gmail.com
patch subject: [PATCH] printf: add __printf attribute
config: um-randconfig-001-20251207 (https://download.01.org/0day-ci/archive/20251207/202512070856.1syRb0ZL-lkp@xxxxxxxxx/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project a805147ac1ba123916de182babb0831fbb148756)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251207/202512070856.1syRb0ZL-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512070856.1syRb0ZL-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> lib/tests/printf_kunit.c:270:1: warning: GCC requires a function with the '__format__' attribute to be variadic [-Wgcc-compat]
270 | test_hashed(struct kunit *kunittest, const char *fmt, const void *p)
| ^
1 warning generated.

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for OF_GPIO
Depends on [n]: GPIOLIB [=y] && OF [=y] && HAS_IOMEM [=n]
Selected by [m]:
- REGULATOR_RT5133 [=m] && REGULATOR [=y] && I2C [=m] && GPIOLIB [=y] && OF [=y]


vim +/__format__ +270 lib/tests/printf_kunit.c

707cc7280f452a lib/test_printf.c Rasmus Villemoes 2015-11-06 268
c23bf7282349cc lib/tests/printf_kunit.c Tamir Duberstein 2025-12-06 269 static void __printf(2, 3)
81a03aa9b88c5d lib/tests/printf_kunit.c Tamir Duberstein 2025-03-07 @270 test_hashed(struct kunit *kunittest, const char *fmt, const void *p)
4d42c44727a062 lib/test_printf.c Andy Shevchenko 2018-12-04 271 {
4d42c44727a062 lib/test_printf.c Andy Shevchenko 2018-12-04 272 char buf[PLAIN_BUF_SIZE];
4d42c44727a062 lib/test_printf.c Andy Shevchenko 2018-12-04 273
81a03aa9b88c5d lib/tests/printf_kunit.c Tamir Duberstein 2025-03-07 274 plain_hash_to_buffer(kunittest, p, buf, PLAIN_BUF_SIZE);
4d42c44727a062 lib/test_printf.c Andy Shevchenko 2018-12-04 275
4d42c44727a062 lib/test_printf.c Andy Shevchenko 2018-12-04 276 test(buf, fmt, p);
4d42c44727a062 lib/test_printf.c Andy Shevchenko 2018-12-04 277 }
4d42c44727a062 lib/test_printf.c Andy Shevchenko 2018-12-04 278

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki