This is the mail archive of the
mailing list for the GCC project.
preprocessor/3571: cpp -traditional inserts line breaks
- To: gcc-gnats at gcc dot gnu dot org
- Subject: preprocessor/3571: cpp -traditional inserts line breaks
- From: Erik Schnetter <schnetter at uni-tuebingen dot de>
- Date: Thu, 5 Jul 2001 15:38:19 +0200
>Synopsis: cpp -traditional inserts line breaks
>Arrival-Date: Thu Jul 05 06:46:01 PDT 2001
>Originator: Erik Schnetter
Theoretische Astrophysik Tuebingen
System: Linux lilypond 2.4.4-4GB #1 Wed May 16 00:37:55 GMT 2001 i686 unknown
configured with: ../gcc-3.0/configure --prefix=/home/eschnett/gcc --enable-shared
I use "cpp -traditional" to preprocess Fortran 77 source code. I
believe that many people do so, and that this is an important use of
cpp. In Fortran 77, all statements have to begin in column 7. "cpp
-traditional" inserts line breaks in macro invocations, and that leads
to syntax errors as certain lines are then broken into two. I give an
The following input to the preprocessor (four lines)
#define ARGUMENTS a\
subroutine yada (ARGUMENTS)
leads to the following output (seven lines)
# 1 "printit.F77"
subroutine yada (a
# 4 "printit.F77"
when the precprcessor is called with "cpp -traditional printit.F77".
Note that the macro ARGUMENTS contains a newline character. Contrary
to the cpp manual, the result of the macro expansion is not a single
line, but two lines.
You can use cpp without the -traditional switch to get correct newline
behaviour. The disadvantage is then that apostrophes in Fortran
comments are treated a string delimiters and cause syntax errors.
This requires changes to Fortran comments.