If I process the following test.def
input file with gcc -C -x c -E test.def
:
#define TEST foo
int TEST;
I would
These are not just on the top - but instead they're the line markers that the C preprocessors use to convey the source code positions where certain lines come from, to the C compiler.
With GCC this is easy, as GCC supports the -P switch, and so does llvm Clang:
-P
. Inhibit generation of linemarkers in the output from the preprocessor. This might be useful when running the preprocessor on something that is not C code, and will be sent to a program which might be confused by the linemarkers.
Thus, use gcc -E -P -x c
.
Also, I'd not use -C
(retain comments), as it seems that with it gcc
adds some comments from implicit header files.