Is there a way to omit the definitions (linear markers) at the top of the C-preprocessor output?

If I process the following input file test.defwith gcc -C -x c -E test.def:

#define TEST foo 
int TEST;

I would like the result to be simple:

int foo;

Instead, I get:

# 1 "test.def"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.def"

int foo;

Is there a way I can omit these extra lines at the top?

+6
source share
1 answer

This is not only at the top, but instead they are line markers that C preprocessors use to transfer the positions of the source code where certain lines come from to the C compiler.


GCC , GCC -P llvm Clang:

-P. . -, C, , linemarkers.

, gcc -E -P -x c.

, -C ( ), , gcc .

+7

Source: https://habr.com/ru/post/1016520/


All Articles