Skip to main content

Questions tagged [preprocessor]

Use this tag for questions about tools that manipulate source code before the primary compilation step, and language designs relying on them

0 votes
1 answer
152 views

Is it possible to apply # to a string literal resulting from another # in C?

In implementing the C preprocessor, I'm considering implementing the # operator not as converting the token sequence to a string literal, but to a special "...
DannyNiu's user avatar
  • 467
-2 votes
2 answers
268 views

If this is the actual behavior of c preprocessor, then how should I interpret the standard if I were to implement it?

In the C standard, there's this: A parameter in the replacement list, ..., is replaced by the corresponding argument after all macros contained therein have been expanded. It's in Section 6.10.x.x, ...
DannyNiu's user avatar
  • 467
0 votes
1 answer
481 views

How would you implement a language in which the function-name could be separated from function arguments two different ways?

Suppose that there was a programming language in which there were two different syntaxes for function calls. An example of this is shown below: ...
Samuel Muldoon's user avatar
3 votes
2 answers
152 views

How can the pitfalls of preprocessor macros be mitigated/avoided?

A controversial topic among programming language designers is preprocessor macros such as #define directives in C. They can cause problems if used incorrectly. <...
CPlus's user avatar
  • 10.5k