3 ms·
If you have access to the whole codebase, and the ability to ask the system for code after macro expansion, you can do any kind of analysis you want.
by Firadeoclus 5y ago
If you have access to the whole codebase, and the ability to ask the system for code after macro expansion, you can do any kind of analysis you want.
- skybrian 5y agoOne problem is that macro expansion is arbitrary code execution, which means your static analysis is potentially insecure. But I suppose it could run in a sandbox. A second issue is that the macro-expanded code is a lowered representation compared to to what the user sees. This tends to make user-friendly error reporting harder. Another problem might arise when macro expansion is intermixed with normal execution, making it harder to just expand macros with executing code. Then you can still do a lot in a debugger, but that's quite different than static code analysis.