Is it possible to check if a token is macro or not in the dump file? For example TEST_F macro from googletest is considered a function currently (version 2.1). It might resolve into a function but I would like to be able to see that it is also a macro.
Last edit: samed 2021-08-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you can try to include the system includes if you want but there are drawbacks. in the cfg files there are lots of information that is not available in the headers so cppcheck can find plenty of memory errors etc that will be missed if you just include the headers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it possible to check if a token is macro or not in the dump file? For example TEST_F macro from googletest is considered a function currently (version 2.1). It might resolve into a function but I would like to be able to see that it is also a macro.
Last edit: samed 2021-08-26
I would appreciate if you investigate this a little bit..
In the cfg file googletest.cfg cppcheck can see that TEST_F is a macro.
Then the
Token::isExpandedMacro()
should return true forTEST_F
resulting token.Then a
isExpandedMacro="true"
should be written in the dump file.Where is this broken.
Last edit: Daniel Marjamäki 2021-08-26
Yep, that works. Normal macros automatically show
isExpandedMacro="true"
in the dump file. Why doesTEST_F
require a .cfg file?you can try to include the system includes if you want but there are drawbacks. in the cfg files there are lots of information that is not available in the headers so cppcheck can find plenty of memory errors etc that will be missed if you just include the headers.