From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24913 invoked by alias); 19 May 2003 15:07:22 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 24841 invoked from network); 19 May 2003 15:07:21 -0000 Received: from unknown (HELO egil.codesourcery.com) (66.92.14.122) by sources.redhat.com with SMTP; 19 May 2003 15:07:21 -0000 Received: from zack by egil.codesourcery.com with local (Exim 3.36 #1 (Debian)) id 19HmAX-0000eS-00; Mon, 19 May 2003 08:03:17 -0700 To: Paul Koning Cc: gdr@integrable-solutions.net, neil@daikokuya.co.uk, gcc@gcc.gnu.org Subject: Re: Warning for trigraphs in comment? References: <20030518193113.GC13596@daikokuya.co.uk> <16072.55751.300819.237661@pkoning.dev.equallogic.com> <871xyvf1pu.fsf@egil.codesourcery.com> <16072.60344.109869.222568@pkoning.dev.equallogic.com> From: Zack Weinberg Date: Mon, 19 May 2003 15:10:00 -0000 In-Reply-To: <16072.60344.109869.222568@pkoning.dev.equallogic.com> (Paul Koning's message of "Mon, 19 May 2003 10:35:36 -0400") Message-ID: <87u1brdlmy.fsf@egil.codesourcery.com> User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg01763.txt.bz2 Paul Koning 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 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