#include <cstdint> enum testEnum : uint32_t { a }; int main(){ 1 / sizeof(testEnum); //This statement reports an error; //1 / sizeof(uint32_t); //This statement is OK; return 0; }
error report: Checking sizeof_enum_uint32_t.cpp ... sizeof_enum_uint32_t.cpp:10:7: error: Division by zero. [zerodiv] 1 / sizeof(testEnum); //This statement reports an error; ^
I think it is a bug. Anyone meets this problem ?
sizeof_enum_uint32_t.cpp
Thanks! I created this ticket: https://trac.cppcheck.net/ticket/9741
Log in to post a comment.
error report:
Checking sizeof_enum_uint32_t.cpp ...
sizeof_enum_uint32_t.cpp:10:7: error: Division by zero. [zerodiv]
1 / sizeof(testEnum); //This statement reports an error;
^
I think it is a bug. Anyone meets this problem ?
Last edit: houzhengtao 2020-05-26
sizeof_enum_uint32_t.cpp
Last edit: houzhengtao 2020-05-26
Thanks! I created this ticket: https://trac.cppcheck.net/ticket/9741