-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: NXPNXPNXPpriority: lowLow impact/importance bugLow impact/importance bug
Description
Describe the bug
- mimxrt1010_evk/mimxrt1011
99fd6d4 is the first bad commit
commit 99fd6d4
Author: Tim Pambor [email protected]
Date: Tue Oct 14 19:12:14 2025 +0200
ztest: Add validation of zassert strings
Add __printf_like attribute to ztest assertion functions
zassert, zassume, zexpect to validate format strings and arguments
at compile time.
Signed-off-by: Tim Pambor <[email protected]>
subsys/testsuite/ztest/include/zephyr/ztest_assert.h | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Regression
- This is a regression.
Steps to reproduce
west build -b mimxrt1010_evk tests/drivers/i2c/i2c_ram
Relevant log output
from /home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/tests/drivers/i2c/i2c_ram/src/test_i2c_ram.c:18:/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/tests/drivers/i2c/i2c_ram/src/test_i2c_ram.c:
In function 'check_completion':/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:184:68:
error: format not a string literal and no format arguments [-Werror=format-security] 184 | __LINE__, __func__, _msg ? msg : "", ##__VA_ARGS__); \ | ^~/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:194:9:
note: in expansion of macro '_zassert_base' 194 | _zassert_base(cond, default_msg, msg, ##__VA_ARGS__) | ^~~~~~~~~~~~~/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:197:9:
note: in expansion of macro '_zassert_va' 197 | _zassert_va(cond, default_msg, COND_CODE_1(__VA_OPT__(1), (__VA_ARGS__), (NULL))) | ^~~~~~~~~~~/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h:292:31:
note: in expansion of macro 'zassert' 292 | #define zassert_ok(cond, ...) zassert(!(cond), #cond " is non-zero", ##__VA_ARGS__) | ^~~~~~~/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/tests/drivers/i2c/i2c_ram/src/test_i2c_ram.c:205:17:
note: in expansion of macro 'zassert_ok' 205 | zassert_ok(result, msg); | ^~~~~~~~~~cc1: all warnings being treated as errorsninja: build stopped: subcommand failed.
Impact
Annoyance – Minor irritation; no significant impact on usability or functionality.
Environment
- OS: ubuntu
- toolchain: Zephyr
- version: v4.2.0-6152-gfd51dde8f5ca
Additional Context
No response
Metadata
Metadata
Labels
bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: NXPNXPNXPpriority: lowLow impact/importance bugLow impact/importance bug