typedef struct { uint8_t var1; uint8_t var2; uint8_t var3; uint8_t var4; } Foo;
constexpr uint8_t var2 = 2; constexpr uint8_t var3 = 3;
Foo foo { .var2 = var2, // <- false positive .var3 = var3 };
Which version do you use? I'm unable to reproduce this with current head.
Cppcheck 2.13.0
Well, 2.18 is current, so you might consider updating.
Log in to post a comment.
typedef struct {
uint8_t var1;
uint8_t var2;
uint8_t var3;
uint8_t var4;
} Foo;
constexpr uint8_t var2 = 2;
constexpr uint8_t var3 = 3;
Foo foo {
.var2 = var2, // <- false positive
.var3 = var3
};
Which version do you use? I'm unable to reproduce this with current head.
Cppcheck 2.13.0
Well, 2.18 is current, so you might consider updating.