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 <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-04-07 09:23:57 +02:00 committed by Carles Cufí
commit e5eb1b179d

View file

@ -127,7 +127,8 @@ extern "C" {
_Generic((v), \ _Generic((v), \
float : sizeof(double), \ float : sizeof(double), \
default : \ default : \
sizeof((v)+0) \ /* coverity[bad_sizeof] */ \
sizeof((v) + 0) \
) )
static inline void cbprintf_wcpy(int *dst, int *src, size_t len) static inline void cbprintf_wcpy(int *dst, int *src, size_t len)