It seems to necessary to specify that the code to enable recursive macro expansion is not conforming to the C Standard.
FOREVER_INDIRECT in the wiki page is defined not to have in it parentheses to invoke FOREVER because that would stop further expansion of FOREVER_INDIRECT. This is, however, is an unspecified behavior and a standard-conforming compiler is free to stop the expansion; refer to DR017Q19 for details.
The reason that most compilers drop the FOREVER_INDIRECT's context when brining parentheses from the outside of its replacement list is that doing so is easier than to keep it.
I think this should be described in the wiki page.
Thanks.
It seems to necessary to specify that the code to enable recursive macro expansion is not conforming to the C Standard.
FOREVER_INDIRECTin the wiki page is defined not to have in it parentheses to invokeFOREVERbecause that would stop further expansion ofFOREVER_INDIRECT. This is, however, is an unspecified behavior and a standard-conforming compiler is free to stop the expansion; refer to DR017Q19 for details.The reason that most compilers drop the
FOREVER_INDIRECT's context when brining parentheses from the outside of its replacement list is that doing so is easier than to keep it.I think this should be described in the wiki page.
Thanks.