public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/7947: cpp0 -std=gnu99 rejects # comments
@ 2002-09-17 11:22 neil
  0 siblings, 0 replies; 5+ messages in thread
From: neil @ 2002-09-17 11:22 UTC (permalink / raw)
  To: bug-hurd, gcc-bugs, gcc-prs, marcus, nobody

Synopsis: cpp0 -std=gnu99 rejects # comments

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Tue Sep 17 11:22:20 2002
State-Changed-Why:
    Not a bug: -std=gnu99 overrides -lang-asm as it comes later;
    it contains an implicit -lang-c.
    
    You might get away with reversing the order (if you can actually achieve that - you may not be able to), but we won't
    guarantee that this will always work.
    
    After all, there are no "standards" with assembler.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7947


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: preprocessor/7947: cpp0 -std=gnu99 rejects # comments
@ 2002-09-17 12:46 Marcus Brinkmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcus Brinkmann @ 2002-09-17 12:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7947; it has been noted by GNATS.

From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: neil@gcc.gnu.org, bug-hurd@gnu.org, gcc-bugs@gcc.gnu.org,
	gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/7947: cpp0 -std=gnu99 rejects # comments
Date: Tue, 17 Sep 2002 21:45:09 +0200

 On Tue, Sep 17, 2002 at 08:22:38PM +0100, Neil Booth wrote:
 > Marcus Brinkmann wrote:-
 > 
 > > That is my fault for not being precise enough in my bug report, sorry.
 > > 
 > > The problem is that gcc calls the preprocessor with this ordering when
 > > compiling an assembler file (foo.S) with the -std=gnu99 option.
 > > 
 > > Try "echo \# foo > foo.S" and "gcc -std=gnu99 -o foo foo.S", this triggers
 > > the bug.  -v shows that gcc passes -std=gnu99 to cpp when preprocessing the
 > > file.
 > 
 > Right, but everything you state is intentional.  -lang-asm deliberately
 > comes first, otherwise it would clobber various other flags the user
 > may have passed, such as -fdollars-in-identifiers, -trigraphs etc.
 > 
 > The problem you have is that -std=gnu99 applies to the C language, and
 > not to assembler.
 > 
 > What is the reason you need to pass the switch?  If it's to avoid a
 > spurious warning, we may be able to disable the warning if -lang-asm.
 > If it's to achieve some additional functionality, we may be able to
 > retain that functionality if -lang-asm.
 
 Ayup, I just see my mistake.  We are setting -std=gnu99 in CPPFLAGS, not CFLAGS. 
 D'oh!  I will put the blame elsewhere then :)
 
 Thanks a lot for your patience,
 Marcus
 
 -- 
 `Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
 Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
 Marcus.Brinkmann@ruhr-uni-bochum.de
 http://www.marcus-brinkmann.de/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: preprocessor/7947: cpp0 -std=gnu99 rejects # comments
@ 2002-09-17 12:26 Neil Booth
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Booth @ 2002-09-17 12:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7947; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
Cc: neil@gcc.gnu.org, bug-hurd@gnu.org, gcc-bugs@gcc.gnu.org,
	gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/7947: cpp0 -std=gnu99 rejects # comments
Date: Tue, 17 Sep 2002 20:22:38 +0100

 Marcus Brinkmann wrote:-
 
 > That is my fault for not being precise enough in my bug report, sorry.
 > 
 > The problem is that gcc calls the preprocessor with this ordering when
 > compiling an assembler file (foo.S) with the -std=gnu99 option.
 > 
 > Try "echo \# foo > foo.S" and "gcc -std=gnu99 -o foo foo.S", this triggers
 > the bug.  -v shows that gcc passes -std=gnu99 to cpp when preprocessing the
 > file.
 
 Right, but everything you state is intentional.  -lang-asm deliberately
 comes first, otherwise it would clobber various other flags the user
 may have passed, such as -fdollars-in-identifiers, -trigraphs etc.
 
 The problem you have is that -std=gnu99 applies to the C language, and
 not to assembler.
 
 What is the reason you need to pass the switch?  If it's to avoid a
 spurious warning, we may be able to disable the warning if -lang-asm.
 If it's to achieve some additional functionality, we may be able to
 retain that functionality if -lang-asm.
 
 Neil.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: preprocessor/7947: cpp0 -std=gnu99 rejects # comments
@ 2002-09-17 11:56 Marcus Brinkmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcus Brinkmann @ 2002-09-17 11:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7947; it has been noted by GNATS.

From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
To: neil@gcc.gnu.org, bug-hurd@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/7947: cpp0 -std=gnu99 rejects # comments
Date: Tue, 17 Sep 2002 20:46:42 +0200

 I have no idea if just replying to this works, with all those CC's, but I
 hope for the best.
 
 On Tue, Sep 17, 2002 at 06:22:20PM -0000, neil@gcc.gnu.org wrote:
 > Synopsis: cpp0 -std=gnu99 rejects # comments
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: neil
 > State-Changed-When: Tue Sep 17 11:22:20 2002
 > State-Changed-Why:
 >     Not a bug: -std=gnu99 overrides -lang-asm as it comes later;
 >     it contains an implicit -lang-c.
 >     
 >     You might get away with reversing the order (if you can actually achieve that - you may not be able to), but we won't
 >     guarantee that this will always work.
 >     
 >     After all, there are no "standards" with assembler.
 
 That is my fault for not being precise enough in my bug report, sorry.
 
 The problem is that gcc calls the preprocessor with this ordering when
 compiling an assembler file (foo.S) with the -std=gnu99 option.
 
 Try "echo \# foo > foo.S" and "gcc -std=gnu99 -o foo foo.S", this triggers
 the bug.  -v shows that gcc passes -std=gnu99 to cpp when preprocessing the
 file.
 
 Thanks,
 Marcus
 
 
 -- 
 `Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
 Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
 Marcus.Brinkmann@ruhr-uni-bochum.de
 http://www.marcus-brinkmann.de/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* preprocessor/7947: cpp0 -std=gnu99 rejects # comments
@ 2002-09-17  6:36 marcus
  0 siblings, 0 replies; 5+ messages in thread
From: marcus @ 2002-09-17  6:36 UTC (permalink / raw)
  To: gcc-gnats; +Cc: bug-hurd


>Number:         7947
>Category:       preprocessor
>Synopsis:       cpp0 -std=gnu99 rejects # comments
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 17 06:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Marcus Brinkmann
>Release:        gcc (GCC) 3.2 (20020809) Debian prerelease
>Organization:
>Environment:
i386-gnu
>Description:
The bug only appears with -std=gnu99.

The preprocessor rejects # comments on a line of their own
when compiling assembler code.
>How-To-Repeat:
$ echo "# foo" | cpp -lang-asm -std=gnu99
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
<stdin>:1:3: invalid preprocessing directive #foo
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-17 19:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-17 11:22 preprocessor/7947: cpp0 -std=gnu99 rejects # comments neil
  -- strict thread matches above, loose matches on Subject: below --
2002-09-17 12:46 Marcus Brinkmann
2002-09-17 12:26 Neil Booth
2002-09-17 11:56 Marcus Brinkmann
2002-09-17  6:36 marcus

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).