From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18659 invoked by alias); 7 Apr 2010 02:10:19 -0000 Received: (qmail 17799 invoked by uid 22791); 7 Apr 2010 02:09:55 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Apr 2010 02:09:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C59702BAB34; Tue, 6 Apr 2010 22:09:48 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YtXhOwyqthmc; Tue, 6 Apr 2010 22:09:48 -0400 (EDT) Received: from [127.0.0.1] (nile.gnat.com [205.232.38.5]) by rock.gnat.com (Postfix) with ESMTP id 203F42BAAE7; Tue, 6 Apr 2010 22:09:47 -0400 (EDT) Message-ID: <4BBBE959.7040800@adacore.com> Date: Wed, 07 Apr 2010 06:46:00 -0000 From: Robert Dewar User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Laurent GUERBY CC: Joe Buck , Chris Lattner , =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= , Benjamin Kosnik , "libstdc++@gcc.gnu.org" , "gcc@gcc.gnu.org" Subject: Re: RFC: c++ diagnostics References: <20100405082033.7a9bcf81@redhat.com> <4758A2DF-1B47-4838-A1DE-F755B29DC0F3@apple.com> <20100406190255.GN3872@synopsys.com> <1270585810.3949.391.camel@pc2.unassigned-domain> In-Reply-To: <1270585810.3949.391.camel@pc2.unassigned-domain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg00110.txt.bz2 Laurent GUERBY wrote: > On Tue, 2010-04-06 at 12:02 -0700, Joe Buck wrote: >>>>> http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html >>>> ...As it happens, some C++ diagnostics are better than the >>>> same diagnostic for C and viceversa. >> On Tue, Apr 06, 2010 at 09:45:11AM -0700, Chris Lattner wrote: >>> I think all the C examples are also valid C++ code, they should apply equally well, but I admit that I didn't try those on g++ to see how it does. I figured it also didn't matter much because there has surely been significant progress since gcc 4.2. >> Yes, g++ does a better job for some of Chris's examples than gcc does. >> >> For the second example we get >> >> t.c:1: error: 'pid_t' has not been declared >> >> For the third example: >> t.c:2: error: 'int64' does not name a type >> >> However, most of the criticisms do apply, and the spell checker is a >> very good idea. > > The Ada FE does it FWIW: > > $ cat p.ads > pakage P is > subtype My_Count is Intger > end P; > $ gcc -c -gnatq p.ads > p.ads:1:01: incorrect spelling of keyword "package" > p.ads:2:23: "Intger" is undefined > p.ads:2:23: possible misspelling of "Integer" > p.ads:2:29: missing ";" The algorithm used in the Ada compiler is in g-speche.ads and it seems to be just right for use by the compiler. > $ > > The checker is in gcc/ada/g-spchge.adb > > Laurent >