Menu

Enumeration size for c code

Daniel
2026-01-08
2026-02-25
  • Daniel

    Daniel - 2026-01-08

    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.

     
  • Oliver Stöneberg

    Thanks for your report. I filed https://trac.cppcheck.net/ticket/14537 about supporting this.

     

Log in to post a comment.

MongoDB Logo MongoDB