[clang] Extension: allow recursive macros (PR #65851)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 9 13:56:06 PDT 2023


kelbon wrote:

> How would you deal with the issue of infinite loops? The following program:
> 
> ```c++
> #define2 boom(X) boom(X)
> 
> boom(0)
> ```
> 
> Will continue to infinitely(?) consume memory until it is killed, either by the user or due to running out of memory on the system

As fo other similar things like templates/inheriting/includes must be recursion depth limit, but in this case "MacroInfo" required to be 40 bytes(and code dont says for what, but i expect some runtime sized structs etc), so now i think how to do it better

https://github.com/llvm/llvm-project/pull/65851


More information about the cfe-commits mailing list