public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Zack Weinberg" <zackw@stanford.edu>
To: Linus Torvalds <torvalds@transmeta.com>, gcc@gcc.gnu.org
Subject: Re: Trigraph warnings when compiling linux-2.4.0-prerelease1
Date: Wed, 03 Jan 2001 23:39:00 -0000	[thread overview]
Message-ID: <20010103233857.D12948@wolery.stanford.edu> (raw)
In-Reply-To: <m2k88d7mwe.fsf@kelso.bothner.com>

On Tue, Jan 02, 2001 at 11:51:45AM -0800, Per Bothner wrote:
> Linus Torvalds <torvalds@transmeta.com> writes:
> 
> >     -Wtrigraphs
> >          Warn if any trigraphs are encountered (assuming they are enabled).
> > 
> > which certainly implies to me that even if you enabled "-Wtrigraphs", it
> > wouldn't even't cause a warning if trigraphs aren't enabled (and again,
> > it's documented that they are enabled by "-ansi" and by "-trigraphs" and
> > disabled by default).
> 
> That is not my reading of the documentation, nor I think what it
> intended to say. It clearly is silly that -Wtrigraphs would have no
> effect if trigraphs are disabled - you might still want the warning to
> catch cases of unintended trigraphs being miscompiled by other
> compilers.

Historically (with cccp; that's GCC <= 2.95.x for most people) you got
the trigraph warnings only if you put both -Wtrigraphs (or -Wall) and
-trigraphs.  In other words, Linus' reading matches the behavior of
the program for all current official releases of GCC.  I decided when
I started working on cpplib that the trigraph warning should be active
even when trigraph conversion was off.  This has been in place for a
long time, but with different semantics depending on which snapshot
you have.  Redhat's 2.96, if I remember correctly, warns about them
inside comments; current 2.97 snapshots don't.

For user space code, this has in fact been found to be useful.  There
exist C compilers whose only behavior is to silently convert
trigraphs, and some of them are relatively popular.  The example I
know about is DEC/Compaq's C compiler for Alphas.  There's a fair
number of people who want to compile the same code with both GCC and
that compiler.

Current documentation, as pointed out downthread, has been clarified.
I would be open to discussion of whether -Wtrigraphs should be in
-Wall.  On the one hand, it is a rare problem.  On the other, it is
easy to silence the warning, and hard to find the problem if you've
never heard of trigraphs.

You could easily throw -Wno-trigraphs into the kernel Makefiles; that
option has been recognized by GCC since before 2.7.2.

zw

  parent reply	other threads:[~2001-01-03 23:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200101020654.WAA03344@neosilicon.transmeta.com>
2001-01-01 23:00 ` Linus Torvalds
2001-01-02  0:23   ` Fergus Henderson
2001-01-02  9:18   ` Joe Buck
2001-01-02 10:38     ` Linus Torvalds
2001-01-02 10:58       ` Joe Buck
2001-01-02 11:15         ` Linus Torvalds
2001-01-02 11:50           ` Per Bothner
2001-01-02 11:55             ` Linus Torvalds
2001-01-02 12:40               ` Joe Buck
2001-01-02 13:50                 ` Linus Torvalds
2001-01-02 14:50             ` Toon Moene
2001-01-03 23:39             ` Zack Weinberg [this message]
2001-01-02 13:27 dewar
2001-01-02 15:20 ` Joe Buck
2001-01-02 19:03 ` Fergus Henderson
2001-01-03 11:21   ` Joe Buck
  -- strict thread matches above, loose matches on Subject: below --
2001-01-02 12:05 dewar
2001-01-02  9:26 dewar
2001-01-01  9:56 Rich Baum
2001-01-01 11:50 ` Tim Hollebeek
2001-01-01 15:16 ` Joe Buck

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=20010103233857.D12948@wolery.stanford.edu \
    --to=zackw@stanford.edu \
    --cc=gcc@gcc.gnu.org \
    --cc=torvalds@transmeta.com \
    /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).