For example, I have this snippet:
const int array_type = model.accessors[accessor_index].type;
Assert(array_type == TypeCode<T>(), "");
And I get this error:
Src/Engine/Animation/GltfLib.cpp:103:26: style: Variable 'array_type' is assigned a value that is never used. [unreadVariable]
const int array_type = model.accessors[accessor_index].type;
Assert
is a macro that was based on the regular assert
but uses some internal logging mechanisms on top of throwing the error.
Is there a way to make cppcheck notice that the variable is actually used?