Menu

how to handle the macros automatically defined by gcc

wy163
2026-07-04
2026-07-06
  • wy163

    wy163 - 2026-07-04

    Hi,

    For example, STDC is automatically defined by the gcc. Will the cppcheck add such configs automatically?
    How to handle such configs if need the configs to be defined for the checking. Do we need to add them in the command line options.
    Many thanks!

     
  • Andrew C Aitchison

    It doesn't work like that.
    cppcheck works through both paths; if STDC is defined and if it is not.
    If cppcheck says there is no problem, your program will work whether the compiler has set STDC or not.

    *Since this could expand exponentially, by default only a limited number of configurations are tried. Use --force or --max-configs= to expand this limit.

     
  • wy163

    wy163 - 2026-07-05

    Ok, got it, thanks!

     
  • CHR

    CHR - 2026-07-06
     

Log in to post a comment.

Auth0 Logo