You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hmm.. how do you know that is the expected result. The # is a preprocessor token and should be handled by the preprocessor as far as I know. What use is there in a real program?
My intention was like this:
I created this new issue in order to simplify #60.
The problem in #60 might be a consequence of misparsing '# #'.
Since the misparsing happens first, I found it worthwhile to concentrate on this.
thanks for pointing out that preprocessor. For information.. a small and simple preprocessor could easily be integrated into cppcheck if it gets good enough and we see that it's actively maintained.
Activity
danmar commentedon Nov 5, 2017
hmm.. how do you know that is the expected result. The # is a preprocessor token and should be handled by the preprocessor as far as I know. What use is there in a real program?
hexcoder- commentedon Nov 5, 2017
Yes, '#' should be handled by the preprocessor as does '##'. But the semantics between both of them are different.
-> # and ## operators
'# #' should not be silently transformed into '##'.
The 'real use' came from issue #60 while analysing the stack trace.
For reference cpp of gcc gives this
My intention was like this:
I created this new issue in order to simplify #60.
The problem in #60 might be a consequence of misparsing '# #'.
Since the misparsing happens first, I found it worthwhile to concentrate on this.
amai2012 commentedon Nov 7, 2017
MSVC2012 also gives
# #danmar commentedon Nov 11, 2017
ok
asmwarrior commentedon Jan 20, 2018
I see a very nice header only simple C Preprocessor here:glampert/parse-utils: C++ utilities for lexing and parsing of script languages and configuration files., which is a GPLv3 project, and I just comment out the line:
Then I see the parsed result are:
# #I use this code to run the test: parse-utils/test_eval_macros.cpp at master · glampert/parse-utils
danmar commentedon Jan 20, 2018
thanks for pointing out that preprocessor. For information.. a small and simple preprocessor could easily be integrated into cppcheck if it gets good enough and we see that it's actively maintained.
Better handling of standalone # in macros (#108)