开发者

Additional macro support in clang?

开发者 https://www.devze.com 2022-12-22 00:48 出处:网络
Since LLVM/cLang is espec开发者_C百科ially well designed. This seems like a great opportunity to augment the C/C++ macro/preprocessor system.

Since LLVM/cLang is espec开发者_C百科ially well designed.

This seems like a great opportunity to augment the C/C++ macro/preprocessor system.

Does anyone know of

  1. additional macro/preprocessor abilities added by Clang or
  2. side projects to make the macro system more powerful (like turing complete)

Note: I am asking about macros. Not C++ templates. I want this thread to be macro/preprocessor specific.


LLVM/clang is especially well designed. The clang preprocessor is especially nice: It keeps track of macro expansions, etc. I suspect the reason that it has not been extended is that 1. An extended preprocessor is non-standard, and 2. No one has done it. Feel free to extend it. As they say on the LLVM IRC: "Patches are welcome", although I suspect that very non-standard preprocessor extensions may not be.

For an example of a preprocessor taken to the ultimate extreme, take a look at PL/1. ;-)


Why don't you just use M4 as a pre-preprocessor?

0

精彩评论

暂无评论...
验证码 换一张
取 消