Menu

how to handle the macros automatically defined by gcc

wy163
2 days ago
7 hours ago
  • wy163

    wy163 - 2 days ago

    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 - 1 day ago

    Ok, got it, thanks!

     
  • CHR

    CHR - 7 hours ago
     

Log in to post a comment.

Auth0 Logo