anon
anon

Reputation: 42577

Additional macro support in clang?

Since LLVM/cLang is especially 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.

Upvotes: 0

Views: 1061

Answers (2)

Ira Baxter
Ira Baxter

Reputation: 95306

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

Upvotes: 0

Richard Pennington
Richard Pennington

Reputation: 19965

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. ;-)

Upvotes: 1

Related Questions