public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Erik Schnetter <schnetter@uni-tuebingen.de>
To: gcc-gnats@gcc.gnu.org
Subject: preprocessor/3571: cpp -traditional inserts line breaks
Date: Thu, 05 Jul 2001 06:46:00 -0000	[thread overview]
Message-ID: <200107051338.f65DcJU06241@lilypond.tat.physik.uni-tuebingen.de> (raw)

>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:


             reply	other threads:[~2001-07-05  6:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-05  6:46 Erik Schnetter [this message]
2001-09-15 11:15 neil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200107051338.f65DcJU06241@lilypond.tat.physik.uni-tuebingen.de \
    --to=schnetter@uni-tuebingen.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).