struct S { enum class E { e1, e2 }; E e; char* e1; }; void f(S& s) { s.e = S::E::e1; }
t.cpp:7:6: portability: Assigning a pointer to an integer is not portable. [AssignmentAddressToInteger]
I cannot reproduce this with v2.3.
Still happens with current main branch. Use --enable=all.
You are correct. The problem is related to enum class, enum alone does not give a warning.
enum class
enum
Ticket is here: https://trac.cppcheck.net/ticket/10145
Log in to post a comment.
t.cpp:7:6: portability: Assigning a pointer to an integer is not portable. [AssignmentAddressToInteger]
I cannot reproduce this with v2.3.
Still happens with current main branch. Use --enable=all.
You are correct. The problem is related to
enum class
,enum
alone does not give a warning.Ticket is here: https://trac.cppcheck.net/ticket/10145