2

When I execute echo 'int main(){}' | gcc -E -x c - in my shell, I get the following output:

# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "<stdin>"
int main(){}

Until shortly ago, I believed that lines starting with a # are meant for the preprocessor. Since this text stems from the preprocessor itself, there seems also be a meaning of such lines for the c compiler. Yet, I fail to see what they instruct the compiler to do. I also don't know why the preprocessor puts these lines and especially why it refers to /usr/include/stdc-predef.h in the output.

René Nyffenegger
  • 39,402
  • 33
  • 158
  • 293

0 Answers0