Skip to content

Commit 970c715

Browse files
tpambordanieldegrasse
authored andcommitted
sys: cbprintf: Suppress bugprone-sizeof-expression
clang-tidy reports a bugprone-sizeof-expression warning for sizeof((__v)) when __v is a pointer type. This is a false-positive in contexts like logging with %p, where using a pointer is intentional and expected. Add a NOLINT comment to suppress the warning in static analysis. Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
1 parent 9f5492a commit 970c715

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/zephyr/sys/cbprintf_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ extern "C" {
572572
size_t __arg_size = _Generic((v), \
573573
float : sizeof(double), \
574574
default : \
575-
sizeof((__v)) \
575+
sizeof((__v)) /* NOLINT(bugprone-sizeof-expression) */ \
576576
); \
577577
__arg_size; \
578578
})

0 commit comments

Comments
 (0)