Menu

cppc V2.21.0 - warning suppress not working

2026-07-06
2026-07-07
  • Derell Licht

    Derell Licht - 2026-07-06

    I am getting the following error message:

    der_libs\common_win.cpp:274:4: error: There is an unknown macro here somewhere. Configuration is required. If _T is a macro then please configure it. [unknownMacro]
       _T("Text Files (*.TXT)\0*.txt\0") /* cppcheck-suppress [unknownMacro] */ \
       ^
    

    I am including tchar.h in my file, so cppcheck shouldn't be confused about this, but in any case, I'm trying to exclude this error via:

    static TCHAR const szPalFilter[] = 
        // cppcheck-suppress [unknownMacro]
       _T("Text Files (*.TXT)\0*.txt\0") /* cppcheck-suppress [unknownMacro] */ \
       _T("All Files (*.*)\0*.*\0\0") ;
    

    However, neither of these suppress statements remove the message. Is that because it is an error rather than a warning??

    BTW, the file compiles with no warnings, using -Wall ...

     
  • CHR

    CHR - 2026-07-07

    Probably the path to tchar.h is not known to cppcheck. Rather than including that system header in the analysis, you should pass --library=windows --platform=win64, assuming you don't already.

     

Log in to post a comment.

MongoDB Logo MongoDB