`gcc -E -P -C`增加了额外的评论

sin*_*nan 3 c++ gcc

我正在尝试在包含注释的JS文件上运行CPP.我想保留评论,所以我使用的是-C参数gcc -E -P,但是GCC或CPP会添加额外的评论.以下是如何重现:

?  cpp-test  ls
?  cpp-test  touch empty
?  cpp-test  gcc -E -P -x assembler-with-cpp -C empty -o empty.out 
?  cpp-test  cat empty.out
/* Copyright (C) 1991-2013 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <http://www.gnu.org/licenses/>.  */
/* This header is separate from features.h so that the compiler can
   include it implicitly at the start of every compilation.  It must
   not itself include <features.h> or any other header that includes
   <features.h> because the implicit include comes before any feature
   test macros that may be defined in a source file before it first
   explicitly includes a system header.  GCC knows the name of this
   header in order to preinclude it.  */
/* We do support the IEC 559 math functionality, real and complex.  */
/* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) /
   Unicode 6.0.  */
/* We do not support C11 <threads.h>.  */
?  cpp-test  
Run Code Online (Sandbox Code Playgroud)

我如何告诉GCC/CPP不生成这些评论?

小智 5

评论似乎包含对正在发生的事情的解释,特别是那些说compiler can include it implicitly at the start of every compilation和的部分GCC knows the name of this header in order to preinclude it.

有一个gcc错误报告看起来非常类似于您使用的问题解决的问题-nostdinc.