simplecpp
simplecpp copied to clipboard
C++ preprocessor
Continued from issue #159 Error message: testsuite\token_concat.cpp:2: syntax error: failed to expand 'wxSETUPH_PATH', Invalid ## usage when expanding 'wxCONCAT'. Code to reproduce: ``` #define wxCONCAT(text1, text2) text1 ## text2 #define...
Reported in the cppcheck forum: https://sourceforge.net/p/cppcheck/discussion/general/thread/9c0ae79e38/?limit=25 Example code: ``` int main() { char* ptr = 0; #line 16 "main.sc" { #line 12 "main.sc" struct sqlexd sqlstm; } #line 16 "main.sc"...
Preprocessing (in C++17 mode) of code like this: ```cpp #if __has_include() #endif ``` results in an error: ``` /tmp/fail.cpp:1: syntax error: failed to evaluate #if condition ``` This happens regardless...
Code inside `#if 0` should be skipped: ``` #if 0 ' #endif ``` simplecpp output: `1.c:2: syntax error: No pair for character ('). Can't process file. File is either invalid...
Reading the file via `std::istream` includes a considerable overhead caused by `std::istream::sentry` and others. Using C I/O instead reduces the "total Ir" usage by about 10%. Testing with `-q -Ilib/...
The only interesting suppress warning is currently `clang-analyzer-core.NullDereference` since it depends on very complex value flow, might be a false positive and I didn't have the time to review it.
``` // test.h #define SIMPLE(T, NAME) \ T NAME; #define ADVANCED(T, PREFIX, NAME, EXTENSION) \ SIMPLE(T, PREFIX##NAME##EXTENSION) ADVANCED(int, , foo, ) ``` ``` cppcheck -E test.h Checking test.h ... [test.h:6]:...
Issue: https://github.com/danmar/simplecpp/issues/168