如何删除C预处理器默认添加到输出顶部的行?

Rei*_*ica 19 c-preprocessor

我正在尝试在非C代码上使用C预处理器,除了在顶部创建这样的行之外它工作正常:

# 1 "test.java"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.java"
Run Code Online (Sandbox Code Playgroud)

问题是这些行在Java中无效.有没有办法让预处理器不写这些东西?我宁愿不必通过别的方式来运行它,每次只删除前4行.

Whi*_*ind 29

如果您正在使用gcc预处理器:

   -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.
Run Code Online (Sandbox Code Playgroud)

来自gcc cpp手册页