simplecpp
simplecpp copied to clipboard
C++ preprocessor
Input: ``` #define COUNTER_NAME(NAME, ...) NAME##Count #define COMMA , #define DECLARE_COUNTERS(LIST) unsigned long LIST(COUNTER_NAME, COMMA); #define ACTUAL_LIST(FUNCTION, SEPARATOR) \ FUNCTION(event1, int, foo) SEPARATOR \ FUNCTION(event2, char, bar) DECLARE_COUNTERS(ACTUAL_LIST) ``` Output...
The #line can confuse sameline(): ``` #line 1 abc ``` The directive is written on line 1 and so is "abc" and therefore sameline() thinks they are written on the...
Example code: #define MAC2STR(x) x[0],x[1],x[2],x[3],x[4],x[5] #define FT_DEBUG(fmt, args...) if(pGlobalCtx && pGlobalCtx->debug_level>=2) printf("FT-dbg: "fmt, ##args) FT_DEBUG(" %02x:%02x:%02x:%02x:%02x:%02x\n", MAC2STR(pCtx->wlan_intf_addr[i])); Simplecpp does not preprocess this code properly. The MAC2STR is not expanded.
Token pasting to string constants ("abc") and character constants ('c') currently generates an invalidHashHash exception: ```cpp #define NUM_CHAR(str) str##_numch inline auto operator "" _numch(const char *ch, std::size_t size) noexcept ->...
Using creduce requires preprocessed files and gcc -E -P is normally used. I would like to do the same thing using cppcheck. Cppcheck doesn't support -P so I have to...
This code: ``` template constexpr bool IsMatrix = true; ``` gets tokenized to: ``` $ ./cppcheck -E test.cpp template < typename TElem > constexpr bool IsMatrix < Matrix < TElem...
First reported in Cppcheck trac here: https://trac.cppcheck.net/ticket/9538 Code: ``` #define at(x, y) x##y #define b(...) \ aa(__VA_ARGS__, , , , , , , , , , , , , ,...
In forum : https://sourceforge.net/p/cppcheck/discussion/general/thread/2811dc2f3b It was reported that `__VA_OPT__` is not handled. ``` #include #define p1(fmt, ...) printf(fmt __VA_OPT__(,) __VA_ARGS__) void test() { p1("hello"); p1("%s", "hello"); } ```
Hi there, Thanks for making a very useful library. We're wondering if you've been giving thoughts about using a different library like BSD or MIT which makes it easier for...