Skip to content

Commit ea499ca

Browse files
stglooriouscfriedt
authored andcommitted
sys: cbprintf: logging: fix equivalent branches in argify macro
The ((0) ? (arg) : (arg)) compiler trick leads to a codechecker violation: "conditional operator with identical true and false expressions" Replace it by ((0) ? (0) : (arg)) to work around this issue. Signed-off-by: Stefan Gloor <[email protected]>
1 parent 4ba658d commit ea499ca

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
@@ -86,7 +86,7 @@ extern "C" {
8686
* opaque struct pointers. Alternative is to add + 0 but that requires suppressing
8787
* compiler warning about pointer arithmetic and does not cover opaque structs.
8888
*/
89-
#define Z_ARGIFY(arg) ((0) ? (arg) : (arg))
89+
#define Z_ARGIFY(arg) ((0) ? 0 : (arg))
9090

9191
/** @brief Return 1 if argument is a pointer to char or wchar_t
9292
*

0 commit comments

Comments
 (0)