public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: Paul Koning <pkoning@equallogic.com>
Cc: gdr@integrable-solutions.net,  neil@daikokuya.co.uk,  gcc@gcc.gnu.org
Subject: Re: Warning for trigraphs in comment?
Date: Mon, 19 May 2003 15:10:00 -0000	[thread overview]
Message-ID: <87u1brdlmy.fsf@egil.codesourcery.com> (raw)
In-Reply-To: <16072.60344.109869.222568@pkoning.dev.equallogic.com> (Paul Koning's message of "Mon, 19 May 2003 10:35:36 -0400")

Paul Koning <pkoning@equallogic.com> writes:

>  >> Would it make sense to have the lexer ignore trigraphs (i.e., just
>  >> treat ??/ as three characters) unless specifically enabled with
>  >> -fenable-trigraphs?  In the unlikely case that anyone actually
>  >> uses trigraphs, this would enable them to continue doing so.
>
>  Zack> GCC has done this for decades.  See the documentation of the
>  Zack> -trigraphs option.
>
> Oh.  So it looks like what's needed is to have -ansi NOT imply
> -trigraphs.

We can't do that.  It would violate user expectations that -ansi
puts GCC in fully conforming mode.  I should point out here that
GCC's default ignoring of trigraphs is controversial in some circles;
suggest you read through some back issues of comp.std.c.


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

> What is happening with current GCC in production use is that GCC
> choosed NOT to warn for trigraphs in comment even if -Wtrigraph. 

Correct, because the common case of such trigraphs is

  /* some text (???) */

which obviously cannot affect the meaning of the program.  You're
right that ??/\n can change a comment boundary; Neil and I knew that
this was a potential issue but we decided not to worry about it until
it came up, which has now happened, and we've addressed it.

zw

      parent reply	other threads:[~2003-05-19 15:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-18 13:37 Gabriel Dos Reis
2003-05-18 18:54 ` Zack Weinberg
2003-05-18 20:01   ` Neil Booth
2003-05-18 20:14     ` Zack Weinberg
2003-05-19  6:57   ` Gabriel Dos Reis
2003-05-18 19:36 ` Neil Booth
2003-05-19  6:51   ` Gabriel Dos Reis
2003-05-19 13:22     ` Paul Koning
2003-05-19 14:35       ` Zack Weinberg
2003-05-19 14:37         ` Paul Koning
2003-05-19 14:51           ` Gabriel Dos Reis
2003-05-19 14:55             ` Paul Koning
2003-05-19 18:11             ` Joe Buck
2003-05-19 20:04               ` Neil Booth
2003-05-19 15:10           ` Zack Weinberg [this message]

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=87u1brdlmy.fsf@egil.codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdr@integrable-solutions.net \
    --cc=neil@daikokuya.co.uk \
    --cc=pkoning@equallogic.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).