danmar / simplecpp

C++ preprocessor
BSD Zero Clause License
209 stars 83 forks source link

Token pasting/concatenation with ## leads to invalid result #373

Open chrchr-github opened 1 month ago

chrchr-github commented 1 month ago

Input: __attribute()##8;

gcc/clang -E: __attribute()##8; cppcheck -E: __attribute ( )8 ; ==> )8 is one token https://trac.cppcheck.net/ticket/13165

chrchr-github commented 1 month ago

There is unchecked ## processing here (as opposed to Macro::expandHashHash(): https://github.com/danmar/simplecpp/blob/3588ca804f80e1f0abbcaaf15afdf65c7c9d630e/simplecpp.cpp#L3742