Is there a way to specify to cppcheck the size of enums in c code? I have projects with the equivalent of -fshort-enums enabled. Places where enumerations are converted to integer values are showing cppcheck errors. Cppcheck thinks the enumerations are 4 bytes but really the compiler makes them one byte.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way to specify to cppcheck the size of enums in c code? I have projects with the equivalent of -fshort-enums enabled. Places where enumerations are converted to integer values are showing cppcheck errors. Cppcheck thinks the enumerations are 4 bytes but really the compiler makes them one byte.
Thanks for your report. I filed https://trac.cppcheck.net/ticket/14537 about supporting this.