Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
eca9122
Add regression tests for macro expansion
dmcppcheck Nov 8, 2026
131c265
Move the ## checks out of Macro::expandHashHash()
dmcppcheck Nov 8, 2026
3dbca5f
##: pasting a name or number with a string or character literal is an…
dmcppcheck Nov 8, 2026
6a576de
Move the # string building out of Macro::expandHash()
dmcppcheck Nov 8, 2026
191359d
Add combineWithNext() for the token joins in TokenList::combineOperat…
dmcppcheck Nov 8, 2026
6a9acd6
#: keep the space after an operator of two characters
dmcppcheck Nov 8, 2026
92b451a
Move the argument count check into Macro::getMacroParameters()
dmcppcheck Nov 8, 2026
df3b4c0
Add Macro::expandBuiltin() for __FILE__, __LINE__ and __COUNTER__
dmcppcheck Nov 8, 2026
52fb092
Tests: a function-like macro name at the end of the file should not b…
dmcppcheck Nov 8, 2026
953f255
Add Macro::expandDefined() for defined in a replacement list
dmcppcheck Nov 8, 2026
d3c9a69
Add Macro::copyMacroCall() for copying a macro call to one line
dmcppcheck Nov 8, 2026
3bd22f4
Add setLocation() for setting the location of all tokens in a list
dmcppcheck Nov 8, 2026
306faa9
Token::setExpandedFrom() only updates the expanded-from set
dmcppcheck Nov 8, 2026
2677821
Rename Token::mExpandedFrom to mHideSet
dmcppcheck Nov 8, 2026
f203219
The hide set of a token holds macro names instead of Macro pointers
dmcppcheck Nov 8, 2026
6604e52
Add HideSetExpander, macro expansion with hide sets
dmcppcheck Nov 8, 2026
ec5d934
HideSetExpander: get the arguments as written before they are expanded
dmcppcheck Nov 8, 2026
06d3eec
HideSetExpander: handle #
dmcppcheck Nov 8, 2026
b59b105
HideSetExpander: add getOperand() for what a replacement list token i…
dmcppcheck Nov 8, 2026
a62865e
HideSetExpander: handle ##
dmcppcheck Nov 8, 2026
3d44fcc
HideSetExpander: add MacroCall and readMacroCall()
dmcppcheck Nov 8, 2026
6431981
HideSetExpander: add newToken() for tokens from the replacement list
dmcppcheck Nov 8, 2026
f2da8f7
Add Token::addToHideSet() for a set of macro names
dmcppcheck Nov 8, 2026
9d2bbe1
Split Macro::expandDefined() into findDefinedOperand() and definedMac…
dmcppcheck Nov 8, 2026
7f11b76
HideSetExpander: handle defined in a replacement list
dmcppcheck Nov 8, 2026
25e79f2
HideSetExpander: add substituteRange() for a range of the replacement…
dmcppcheck Nov 8, 2026
7515422
HideSetExpander: handle __VA_OPT__
dmcppcheck Nov 8, 2026
07f5f84
HideSetExpander: add getDefined() and getStringified()
dmcppcheck Nov 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ int main(int argc, char **argv)
found = true;
}
break;
case 'h':
if (std::strcmp(arg, "-hideset-expansion")==0) {
dui.hideSetExpansion = true;
found = true;
}
break;
}
if (!found) {
std::cout << "error: option '" << arg << "' is unknown." << std::endl;
Expand Down Expand Up @@ -187,6 +193,7 @@ int main(int argc, char **argv)
std::cout << " -e Output errors only." << std::endl;
std::cout << " -f Fail when errors were encountered (exitcode 1)." << std::endl;
std::cout << " -l Print lines numbers." << std::endl;
std::cout << " -hideset-expansion Use the new macro expansion with hide sets (work in progress)." << std::endl;
return 0;
}

Expand Down
Loading
Loading