public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/3571: cpp -traditional inserts line breaks
@ 2001-09-15 11:15 neil
0 siblings, 0 replies; 2+ messages in thread
From: neil @ 2001-09-15 11:15 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, schnetter
Synopsis: cpp -traditional inserts line breaks
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Sat Sep 15 11:15:27 2001
State-Changed-Why:
Fixed.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3571&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
* preprocessor/3571: cpp -traditional inserts line breaks
@ 2001-07-05 6:46 Erik Schnetter
0 siblings, 0 replies; 2+ messages in thread
From: Erik Schnetter @ 2001-07-05 6:46 UTC (permalink / raw)
To: gcc-gnats
>Number: 3571
>Category: preprocessor
>Synopsis: cpp -traditional inserts line breaks
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Thu Jul 05 06:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Erik Schnetter
>Release: 3.0
>Organization:
Theoretische Astrophysik Tuebingen
>Environment:
System: Linux lilypond 2.4.4-4GB #1 Wed May 16 00:37:55 GMT 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.0/configure --prefix=/home/eschnett/gcc --enable-shared
>Description:
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
example below.
>How-To-Repeat:
The following input to the preprocessor (four lines)
#define ARGUMENTS a\
subroutine yada (ARGUMENTS)
end
leads to the following output (seven lines)
# 1 "printit.F77"
subroutine yada (a
)
# 4 "printit.F77"
end
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.
>Fix:
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.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-15 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-15 11:15 preprocessor/3571: cpp -traditional inserts line breaks neil
-- strict thread matches above, loose matches on Subject: below --
2001-07-05 6:46 Erik Schnetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).