public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Shujing Zhao <pearly.zhao@oracle.com>
Cc: "Manuel López-Ibáñez" <lopezibanez@gmail.com>,
	"GCC Patches" <gcc-patches@gcc.gnu.org>,
	"Paolo Carlini" <paolo.carlini@oracle.com>
Subject: Re: [PATCH C] Fix pr44517
Date: Thu, 24 Jun 2010 11:56:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1006241108070.2149@digraph.polyomino.org.uk> (raw)
In-Reply-To: <4C232325.2020107@oracle.com>

On Thu, 24 Jun 2010, Shujing Zhao wrote:

> Thanks. According to the above discussion, if the token type is CPP_NAME and
> the followed token is not ')' or ',', the error message would be "unknown type
> name %qE". If the token type is CPP_NAME, but followed by ',' or ')', it looks
> like only parameter name is declared and declaration specifier is missed. The
> old message is more appropriate. If the token type is CPP_KEYWORD, such as

Rather than saying the old message is more appropriate, I'd say that you 
can't really tell the difference between (int, pid_t) where a type was 
undeclared and (int a, b) where a type name is needed before "b".  So 
perhaps the messages should say that either a type is undeclared or a type 
is missing before a parameter name.  (Actually, I'd guess that almost all 
function prototypes either name all parameters or no parameters, so in the 
first case it's a very good guess that pid_t is a type and in the second 
it's a very good guess that b is a parameter name.  But that's definitely 
an enhancement for the future.)

The patch is OK without further code changes needed but with one testcase 
fix:

> +int f1(int x, pid_t y, long z, in t) {  /* { dg-error "unknown type name 'pid_t'|unknown type name 'in'" } */

Please use two separate dg-error directives to match the two separate 
error messages.  The second one would use the form with a line number, { 
dg-error "message" "test name" { target *-*-* } line-number }.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2010-06-24 11:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22  8:14 Shujing Zhao
2010-06-22  8:49 ` Manuel López-Ibáñez
2010-06-22  9:57   ` Shujing Zhao
2010-06-22 10:00     ` Manuel López-Ibáñez
2010-06-22 13:36 ` Joseph S. Myers
2010-06-23  9:17   ` Shujing Zhao
2010-06-23  9:31     ` Manuel López-Ibáñez
2010-06-23  9:55       ` Shujing Zhao
2010-06-23 12:24     ` Joseph S. Myers
2010-06-23 12:28       ` Manuel López-Ibáñez
2010-06-23 12:41         ` Joseph S. Myers
2010-06-24 10:50           ` Shujing Zhao
2010-06-24 11:56             ` Joseph S. Myers [this message]
2010-06-25 10:02               ` Shujing Zhao

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=Pine.LNX.4.64.1006241108070.2149@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=lopezibanez@gmail.com \
    --cc=paolo.carlini@oracle.com \
    --cc=pearly.zhao@oracle.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).