Skip to content

Commit e5eb1b1

Browse files
nordic-krchcarlescufi
authored andcommitted
lib: os: cbprintf: Suppress coverity false positive
Coverity is complaining about sizeof(v + 0) and it is used here intentionally to promote variable. Added comment that should suppress this error in the future. Note that this macro will be used in all log messages so without solving it before logging v2 is merged there will be a flood of errors. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent ed20c06 commit e5eb1b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/sys/cbprintf_internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ extern "C" {
127127
_Generic((v), \
128128
float : sizeof(double), \
129129
default : \
130-
sizeof((v)+0) \
130+
/* coverity[bad_sizeof] */ \
131+
sizeof((v) + 0) \
131132
)
132133

133134
static inline void cbprintf_wcpy(int *dst, int *src, size_t len)

0 commit comments

Comments
 (0)