Bug 5289 - "cpp -traditional" inserts spurious line breaks
Summary: "cpp -traditional" inserts spurious line breaks
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 3.0.3
: P2 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-01-06 05:16 UTC by schnetter
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description schnetter 2002-01-06 05:16:01 UTC
I use cpp to preprocess Fortran 77 code.  I call cpp as "cpp
-traditional", and I find that cpp inserts spurious line breaks under
certain circumstances.  cpp from gcc 2.95.3 works fine under the same
circumstances.

Release:
3.0.3

Environment:
System: Linux lilypond 2.4.10-4GB #1 Tue Sep 25 12:33:54 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.3/configure --prefix=/home/eschnett/gcc

How-To-Repeat:
The following three lines of source code (the first line ends with the
backslash) (note the second, empty line)
#define a b\

(a)
get wrongly preprocessed into the three lines

(b
)
I think that the result should consist of two lines only, namely

(b)
without the line break before the closing paren.

The above constellation appears in automatically generated code.
Comment 1 Craig Rodrigues 2002-01-06 07:42:39 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Can you submit an example, with a description?
Comment 2 Craig Rodrigues 2002-01-06 09:04:20 UTC
State-Changed-From-To: feedback->analyzed
State-Changed-Why: I can reproduce your problem with gcc 3.0.3.
    I do not get the same thing with gcc 3.1.
    
    With gcc 3.1 20020104 (experimental), I get:
    # 1 "b.c"
     
     
    (b)
    
    
    
    Is this what you are looking for?
Comment 3 Craig Rodrigues 2002-01-06 09:34:29 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in gcc 3.1
Comment 4 schnetter 2002-01-06 17:53:22 UTC
From: Erik Schnetter <schnetter@uni-tuebingen.de>
To: rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: preprocessor/5289: "cpp -traditional" inserts spurious line breaks
Date: Sun, 6 Jan 2002 17:53:22 +0100

 On Sunday 06 January 2002 16:42, rodrigc@gcc.gnu.org wrote:
 > Synopsis: "cpp -traditional" inserts spurious line breaks
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: rodrigc
 > State-Changed-When: Sun Jan  6 07:42:39 2002
 > State-Changed-Why:
 >     Can you submit an example, with a description?
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&
 >pr=5289
 
 What is wrong with my example and my description in the section 
 "How-To-Tepeat"?  Both show up fine, at least in the gnatsweb interface on 
 "http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5289". 
  Or are you looking for attached files?  The gccbug script didn't give me the 
 opportunity to attach files, although the web interface has such a section.
 
 -erik
 
 -- 
 Erik Schnetter <schnetter@uni-tuebingen.de>
Comment 5 schnetter 2002-01-06 18:16:49 UTC
From: Erik Schnetter <schnetter@uni-tuebingen.de>
To: rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: preprocessor/5289: "cpp -traditional" inserts spurious line breaks
Date: Sun, 6 Jan 2002 18:16:49 +0100

 On Sunday 06 January 2002 18:04, rodrigc@gcc.gnu.org wrote:
 
 >     I can reproduce your problem with gcc 3.0.3.
 >     I do not get the same thing with gcc 3.1.
 
 [schnipp]
 
 >     Is this what you are looking for?
 
 Yes, it is.  Thank you.
 
 -erik
 
 -- 
 Erik Schnetter <schnetter@uni-tuebingen.de>