C preprocessor Macro defining Macro

Macros can't expand into preprocessing directives. From C99 6.10.3.4/3 "Rescanning and further replacement":

The resulting completely macro-replaced preprocessing token sequence is not processed as a preprocessing directive even if it resembles one,


You cannot define macros in other macros, but you can call a macro from your macro, which can get you essentially the same results.

#define B(x) do {printf("%d", (x)) }while(0)
#define A(x) B(x)

so, A(y) is expanded to do {printf("%d", (y)) }while(0)