Menu

cppcheck and boost

2015-07-06
2015-07-07
  • Lieven de Cock

    Lieven de Cock - 2015-07-06

    While trying to reproduce an issue, I however got a lot of those :

    <error file="bar.h" line="0" id="toomanyconfigs" severity="style" msg="The checking of the file will be interrupted because there are too many #ifdef configurations. Checking of all #ifdef configurations can be forced by --force command line option or from GUI preferences. However that may increase the checking time."/>

    the problem I wanted to reproduce was that boost/cstdint.hpp was included and cppcheck signals an error on the following snippet from that file :

    # if UCHAR_MAX == 0xff
         typedef signed char     int8_t;
         typedef signed char     int_least8_t;
         typedef signed char     int_fast8_t;
         typedef unsigned char   uint8_t;
         typedef unsigned char   uint_least8_t;
         typedef unsigned char   uint_fast8_t;
    # else
    #    error defaults not correct; you must hand modify boost/cstdint.hpp
    # endif
    

    ==> # error defaults not correct; you must hand modify boost/cstdint.hpp

    Please advice on how to get rid of all this noise ?

     

    Last edit: Lieven de Cock 2015-07-06
  • Daniel Marjamäki

    adding a -DUCHAR_MAX=255 on the command line should fix this error message.

    when you use -D, the --max-configs is automatically changed to 1. if you want you can use for instance --max-configs=10 or --force also to override this behaviour.

     

Log in to post a comment.