https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65387

            Bug ID: 65387
           Summary: cpp -C emits extraneous comment header on every file
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugs at stellardeath dot org

cpp is often (mis)used for non-C files, many Fortran projects for example
prefer to run a separate preprocessor step by invoking cpp by hand instead of
relying on the built-in preprocessing of the fortran compiler (don't ask why -
I don't understand it either).

In order not to mess up anything in the non-C file, cpp is usually invoked as

  cpp -C -P -traditional

The "-C" flag started to make problems in recent versions(?), as this now emits
a large comment header on every file:

#> echo "asd" | cpp -C -P
/* Copyright (C) 1991-2015 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.  */
/* glibc's intent is to support the IEC 559 math functionality, real
   and complex.  If the GCC (4.9 and later) predefined macros
   specifying compiler intent are available, use them to determine
   whether the overall intent is to support these features; otherwise,
   presume an older compiler has intent to support these features and
   define these macros by default.  */
/* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) /
   Unicode 6.0.  */
/* We do not support C11 <threads.h>.  */
asd


Would it be too much trouble to not include this extraneous header?

Kind regards,
  Lorenz

Reply via email to