From: Shujing Zhao <pearly.zhao@oracle.com>
To: Jason Merrill <jason@redhat.com>
Cc: "Manuel López-Ibáñez" <lopezibanez@gmail.com>,
Joseph <joseph@codesourcery.com>,
Gcc-Patches <gcc-patches@gcc.gnu.org>,
"Paolo Carlini" <paolo.carlini@oracle.com>
Subject: Re: [PATCH C/C++] Fix some diagnostics problems
Date: Sat, 12 Jun 2010 07:55:00 -0000 [thread overview]
Message-ID: <4C132F20.80901@oracle.com> (raw)
In-Reply-To: <AANLkTikGONsXMYwxheVyOveIgHn9732R4KtlZorKtct_@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]
On 06/11/2010 06:03 PM, Manuel López-Ibáñez wrote:
> On 11 June 2010 11:54, Shujing Zhao <pearly.zhao@oracle.com> wrote:
>> I agree with your last comment to use %qP for parmnum.
>>
>> About this issue, I think the comment is not wrong when FNDECL is non-NULL.
>> How about to add the case when FNDECL is NULL? just as the following:
>>
>> /* If FNDECL is non-NULL, we are doing the conversion in order to pass the
>> PARMNUMth argument of FNDECL. If FNDECL is NULL, we are doing the conversion
>> in function pointer argument passing, conversion in initialization, etc. */
>>
>> If you agree with it, I'll submit the patch.
>
> In that function, fndecl is only used for providing better
> diagnostics. Right now, the diagnostic is less informative when using
> a pointer than when not. I think it should be equally informative.
> That said, your proposal is better than nothing of course.
>
> Manuel.
Jason,
This patch is to use %qP for parnum and fix the comment of
convert_for_assignment and convert_for_initialization.
Retested on 1686-pc-linux-gnu. Is it ok?
Thanks
Pearly
[-- Attachment #2: ChangeLog --]
[-- Type: text/plain, Size: 187 bytes --]
2010-06-12 Shujing Zhao <pearly.zhao@oracle.com>
* typeck.c (convert_for_assignment): Fix comment. Change message
format from %d to %qP.
(convert_for_initialization): Fix comment.
[-- Attachment #3: i18n.patch --]
[-- Type: text/x-patch, Size: 1654 bytes --]
Index: typeck.c
===================================================================
--- typeck.c (revision 160644)
+++ typeck.c (working copy)
@@ -7186,10 +7186,11 @@ delta_from_ptrmemfunc (tree t)
}
/* Convert value RHS to type TYPE as preparation for an assignment to
- an lvalue of type TYPE. ERRTYPE is a string to use in error
- messages: "assignment", "return", etc. If FNDECL is non-NULL, we
- are doing the conversion in order to pass the PARMNUMth argument of
- FNDECL. */
+ an lvalue of type TYPE. ERRTYPE indicates what kind of error the
+ implicit conversion is. If FNDECL is non-NULL, we are doing the
+ conversion in order to pass the PARMNUMth argument of FNDECL.
+ If FNDECL is NULL, we are doing the conversion in function pointer
+ argument passing, conversion in initialization, etc. */
static tree
convert_for_assignment (tree type, tree rhs,
@@ -7331,7 +7332,7 @@ convert_for_assignment (tree type, tree
case ICR_DEFAULT_ARGUMENT:
if (fndecl)
warning (OPT_Wmissing_format_attribute,
- "parameter %d of %qD might be a candidate "
+ "parameter %qP of %qD might be a candidate "
"for a format attribute", parmnum, fndecl);
else
warning (OPT_Wmissing_format_attribute,
@@ -7386,7 +7387,7 @@ convert_for_assignment (tree type, tree
/* Convert RHS to be of type TYPE.
If EXP is nonzero, it is the target of the initialization.
- ERRTYPE is a string to use in error messages.
+ ERRTYPE indicates what kind of error the implicit conversion is.
Two major differences between the behavior of
`convert_for_assignment' and `convert_for_initialization'
next prev parent reply other threads:[~2010-06-12 6:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 4:13 Shujing Zhao
2010-06-08 10:42 ` Joseph S. Myers
2010-06-08 13:45 ` Gabriel Dos Reis
2010-06-08 19:08 ` Jason Merrill
2010-06-08 19:11 ` Jason Merrill
2010-06-09 3:20 ` Shujing Zhao
2010-06-09 4:39 ` Jason Merrill
2010-06-09 9:23 ` Shujing Zhao
2010-06-09 13:00 ` Jason Merrill
2010-06-10 7:07 ` Shujing Zhao
2010-06-10 13:13 ` Jason Merrill
2010-06-11 6:02 ` Shujing Zhao
2010-06-11 9:33 ` Manuel López-Ibáñez
2010-06-11 9:40 ` Manuel López-Ibáñez
2010-06-11 10:50 ` Shujing Zhao
2010-06-11 11:22 ` Manuel López-Ibáñez
2010-06-12 7:55 ` Shujing Zhao [this message]
2010-06-12 13:44 ` Jason Merrill
-- strict thread matches above, loose matches on Subject: below --
2010-06-04 9:39 Shujing Zhao
2010-06-05 13:18 ` Joseph S. Myers
2010-06-07 9:33 ` Shujing Zhao
2010-06-07 13:27 ` Joseph S. Myers
2010-06-08 4:09 ` 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=4C132F20.80901@oracle.com \
--to=pearly.zhao@oracle.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=joseph@codesourcery.com \
--cc=lopezibanez@gmail.com \
--cc=paolo.carlini@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).