public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@adacore.com>
To: Laurent GUERBY <laurent@guerby.net>
Cc: "Joe Buck" <Joe.Buck@synopsys.COM>,
	"Chris Lattner" <clattner@apple.com>,
	"Manuel López-Ibáñez" <lopezibanez@gmail.com>,
	"Benjamin Kosnik" <bkoz@redhat.com>,
	"libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: RFC: c++ diagnostics
Date: Wed, 07 Apr 2010 06:46:00 -0000	[thread overview]
Message-ID: <4BBBE959.7040800@adacore.com> (raw)
In-Reply-To: <1270585810.3949.391.camel@pc2.unassigned-domain>

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
> 

  reply	other threads:[~2010-04-07  2:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05 15:20 Benjamin Kosnik
2010-04-05 17:24 ` Chris Lattner
2010-04-05 19:51   ` Benjamin Kosnik
2010-04-05 19:54     ` Chris Lattner
2010-04-05 18:59 ` Manuel López-Ibáñez
2010-04-05 19:44   ` Benjamin Kosnik
2010-04-06 16:00 ` Chris Lattner
2010-04-06 16:20   ` Joe Buck
2010-04-06 16:29   ` Manuel López-Ibáñez
2010-04-06 16:45     ` Chris Lattner
2010-04-06 19:03       ` Joe Buck
2010-04-06 21:02         ` Laurent GUERBY
2010-04-07  6:46           ` Robert Dewar [this message]
2010-04-14  6:24 ` Manuel López-Ibáñez
2010-04-14 13:18 ` Manuel López-Ibáñez

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=4BBBE959.7040800@adacore.com \
    --to=dewar@adacore.com \
    --cc=Joe.Buck@synopsys.COM \
    --cc=bkoz@redhat.com \
    --cc=clattner@apple.com \
    --cc=gcc@gcc.gnu.org \
    --cc=laurent@guerby.net \
    --cc=libstdc++@gcc.gnu.org \
    --cc=lopezibanez@gmail.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).