gcc -P prevents the preprocessor from including line markers in its output. foo.h): #include "foo.h"
int main() {}
foo.h is even more simple: int foo();
main.c, one using the -P option and one without it: all: main_p.i main.i main.o: main.i gcc -c $< -o $@ main_p.i: main.c foo.h gcc -E -P $< -o $@ main.i: main.c foo.h gcc -E $< -o $@
main.i is the file that was created without the -P option. Thus, it contains line markers in it: # 1 "main.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "main.c"
# 1 "foo.h" 1
int foo();
# 2 "main.c" 2
int main() {}
main_p.i was created with the -P option. Thus, it contains no line markers: int foo();
int main() {}