Does anyone know any simple website or tool or vscode-extension that replace all macros directly into the source code ? I tried to search on google/vscode-extension something like antimacro ...
, remove macro ...
, replace macro ...
but find no result. Thanks for helping ^^
Expanding macros is work of the preprocessor, which is already there in the compiler. G++ has a flag -E (expand macros). Use it like this:
It was helpful, just wondering if I can expand inline function too ^^
Inline functions cannot really be expanded as code; think about how you would inline conflicting variable declarations, or return statements. In the compiler they're typically inlined after being translated to the IR.
Thank ecnerwala can I ask one more question ? Is there such vscode-extension or website that expands the macros directly instead of calling terminal to run
g++ -E file.cpp
each time ?Well, I'm sure you can find (or make!) a VSCode extension to run arbitrary terminal commands. I don't know of one, though.
Thanks
Thanks for sharing. This can actually help during hacking phase.