Is there anyway to see what you code looks like after the preprocessor has done all the substitutions?
Preprocessing is a stage where preprocessor directives are expanded or processed before source code is sent to the compiler. The most common example of such directive is #include or #define. A preprocessor output has “. i” extension.
This is called token pasting or token concatenation. The ' ## ' preprocessing operator performs token pasting.
In computer science, a preprocessor (or precompiler) is a program that processes its input data to produce output that is used as input to another program. The output is said to be a preprocessed form of the input data, which is often used by some subsequent programs like compilers.
4.3 Preprocessing source files If this file is called 'test. c' the effect of the preprocessor can be seen with the following command line: $ gcc -E test. c # 1 "test.
For gcc just use the -E
switch
gcc -E
-E Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output.
That depends on your compiler. With gcc
, you would use:
gcc -E source.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With