public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/10614: -Wtrigraphs does not catch // ??/
@ 2003-05-04 9:26 Hallvard B Furuseth
0 siblings, 0 replies; 5+ messages in thread
From: Hallvard B Furuseth @ 2003-05-04 9:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR preprocessor/10614; it has been noted by GNATS.
From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
To: neil@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/10614: -Wtrigraphs does not catch // ??/
Date: Sun, 4 May 2003 11:20:12 +0200
neil@gcc.gnu.org writes:
> Not a bug. -Wcomment(s) does what you want.
Sorry, no. What I want is for -Wtrigraphs to warn about code that will
compile differently with and without trigraph support. However,
- The warning from gcc -trigraphs -Wcomments gives no indication of
this; it could come from a `//..\' line.
- The warning is only given when -trigraphs or -std=c99 is given.
So if I just compile with 'gcc -Wcomments', I'll get no clue that the
program will silently compile differently on an ISO C compiler.
--
Hallvard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: preprocessor/10614: -Wtrigraphs does not catch // ??/
@ 2003-05-04 10:26 Hallvard B Furuseth
0 siblings, 0 replies; 5+ messages in thread
From: Hallvard B Furuseth @ 2003-05-04 10:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR preprocessor/10614; it has been noted by GNATS.
From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: gcc-bugs@gcc.gnu.org,
Zack Weinberg <zack@codesourcery.com>,
gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/10614: -Wtrigraphs does not catch // ??/
Date: Sun, 4 May 2003 12:24:20 +0200
Neil Booth writes:
> You could persuade me that it's worthwhile warning for ??/ followed by
> a newline in any kind of comment with -Wtrigraphs.
Sounds good. As I said in report preprocessor/10613, I think it's
important to warn about _silent_ changes from ISO C.
I suggest you also warn about ??/ <spaces/tabs> <newline>, since
gcc ignores these spaces/tabs (with a warning).
> it would warn about ??/ followed by a newline in C block comments that
> don't change behaviour, but I don't think that would bother those who
> want trigraph warnings off in comments.
Right. If it bothers anyone, you could add a comment in the -Wtrigraphs
doc that ??/<newline> in comments is warned about because it _may_
change the meaning of the program, and leave it at that.
> Is that an acceptable compromise?
Yes, fine.
--
Hallvard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: preprocessor/10614: -Wtrigraphs does not catch // ??/
@ 2003-05-04 9:56 Neil Booth
0 siblings, 0 replies; 5+ messages in thread
From: Neil Booth @ 2003-05-04 9:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR preprocessor/10614; it has been noted by GNATS.
From: Neil Booth <neil@daikokuya.co.uk>
To: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
Cc: gcc-bugs@gcc.gnu.org, Zack Weinberg <zack@codesourcery.com>,
gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/10614: -Wtrigraphs does not catch // ??/
Date: Sun, 4 May 2003 10:52:12 +0100
Hallvard B Furuseth wrote:-
> neil@gcc.gnu.org writes:
> > Not a bug. -Wcomment(s) does what you want.
>
> Sorry, no. What I want is for -Wtrigraphs to warn about code that will
> compile differently with and without trigraph support. However,
Ah, I see.
That is quite a strict condition, and not one I'm willing to implement
because of the cost and ugliness of the checks in C comments.
For example, we turn off -Wtrigraphs in comments because that is what
many people have requested, but IMO adding a lot of code to warn that
an instance of ??/\n, or multiple thereof, that happen to be preceded by
'*' and followed by '/' and would therefore terminate a C block comment
is unreasonable, but does lead to differing behaviour with and without
-trigraphs.
> - The warning from gcc -trigraphs -Wcomments gives no indication of
> this; it could come from a `//..\' line.
>
> - The warning is only given when -trigraphs or -std=c99 is given.
> So if I just compile with 'gcc -Wcomments', I'll get no clue that the
> program will silently compile differently on an ISO C compiler.
You could persuade me that it's worthwhile warning for ??/ followed by
a newline in any kind of comment with -Wtrigraphs. This would be
fairly simple to implement, and would mean that -Wtrigraphs warns about
all program-changing behaviour. In addition, it would warn about ??/
followed by a newline in C block comments that don't change behaviour,
but I don't think that would bother those who want trigraph warnings
off in comments.
Is that an acceptable compromise?
Neil.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: preprocessor/10614: -Wtrigraphs does not catch // ??/
@ 2003-05-04 9:05 neil
0 siblings, 0 replies; 5+ messages in thread
From: neil @ 2003-05-04 9:05 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, h.b.furuseth, nobody
Synopsis: -Wtrigraphs does not catch // ??/
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Sun May 4 09:05:54 2003
State-Changed-Why:
Not a bug. -Wcomment(s) does what you want.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10614
^ permalink raw reply [flat|nested] 5+ messages in thread
* preprocessor/10614: -Wtrigraphs does not catch // ??/
@ 2003-05-03 23:36 Hallvard B Furuseth
0 siblings, 0 replies; 5+ messages in thread
From: Hallvard B Furuseth @ 2003-05-03 23:36 UTC (permalink / raw)
To: gcc-gnats
>Number: 10614
>Category: preprocessor
>Synopsis: -Wtrigraphs does not catch // ??/
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat May 03 23:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Hallvard B Furuseth
>Release: 3.2.3
>Organization:
University of Oslo
>Environment:
System: SunOS bombur.uio.no 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.2.3/configure --enable-languages=c,c++,f77 --disable-shared --disable-multilib --prefix=/usit/bombur/hbf --enable-version-specific-runtime-libs --enable-threads
>Description:
-Wtrigraphs should warn about `//' comment lines that end with
`??/', since -trigraphs changes whether or not the next line is
taken to be part of the comment.
Also, when that is fixed, the the description of -Wtrigraphs
should mention this exception to the statement that trigraphs in
comments are not warned about.
>How-To-Repeat:
bash$ cat a.c
#include <stdio.h>
int main()
{
// multi-line comment ??/
puts("oops");
return 0;
}
bash$ gcc -trigraphs -Wtrigraphs a.c
bash$ ./a.out
bash$
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-05-04 10:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-04 9:26 preprocessor/10614: -Wtrigraphs does not catch // ??/ Hallvard B Furuseth
-- strict thread matches above, loose matches on Subject: below --
2003-05-04 10:26 Hallvard B Furuseth
2003-05-04 9:56 Neil Booth
2003-05-04 9:05 neil
2003-05-03 23:36 Hallvard B Furuseth
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).