This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] warn on dead function calls in ipa-pure-const [1/4]
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>, Richard Biener <rguenther at suse dot de>, Jan Hubicka <hubicka at ucw dot cz>, gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 31 Jul 2016 18:31:03 +0200
- Subject: Re: [RFC] warn on dead function calls in ipa-pure-const [1/4]
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjMkg_iMo1RB3P+Ey7Q9AitApXQbTsat8DMR+0=FwynFgZg@mail.gmail.com> <alpine.DEB.2.20.1607292112320.24174@digraph.polyomino.org.uk>
> On Tue, 26 Jul 2016, Prathamesh Kulkarni wrote:
>
> > + warning_at (gimple_location (g), OPT_Wunused_value,
> > + "Call from %s to %s has no effect",
> > + e->caller->name (), e->callee->name ());
>
> Diagnostics should not start with capital letters. Function names in
> diagnostics should be quoted, so %qs. Also, what form is this name in?
> If it's the internal UTF-8 form, you need to use identifier_to_locale on
> it to produce something suitable for a diagnostic. And for C++ you need
> to make sure the name is a proper pretty name (including classes /
> namespaces / type etc.) as produced by the decl_printable_name langhook,
> before passing it to identifier_to_locale.
I think you just want to pass e->caller->decl (with corresponding % formatter)
rather than name()
Honza