This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING] Re: [PATCH] c/66516 - missing diagnostic on taking the address of a builtin function
- From: Jason Merrill <jason at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Joseph Myers <joseph at codesourcery dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Marek Polacek <polacek at redhat dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 2 Sep 2015 11:29:30 -0400
- Subject: Re: [PING] Re: [PATCH] c/66516 - missing diagnostic on taking the address of a builtin function
- Authentication-results: sourceware.org; auth=none
- References: <5587432A dot 9000602 at redhat dot com> <20150622144010 dot GK10139 at redhat dot com> <5588BD78 dot 4030607 at gmail dot com> <20150623101829 dot GQ10139 at redhat dot com> <20150623102909 dot GK10247 at tucnak dot redhat dot com> <55897735 dot 1040509 at redhat dot com> <5590965B dot 6030103 at gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1507021411440 dot 29415 at digraph dot polyomino dot org dot uk> <55985EE0 dot 3060802 at gmail dot com> <55A483E8 dot 7060708 at gmail dot com> <55A52443 dot 10800 at redhat dot com> <55A54DBF dot 7080702 at gmail dot com> <55B84AAA dot 7040503 at redhat dot com> <55E0BD94 dot 2060105 at gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1508282006110 dot 18238 at digraph dot polyomino dot org dot uk> <55E0D399 dot 6050807 at gmail dot com> <55E5BDA3 dot 5060005 at gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1509011727370 dot 11400 at digraph dot polyomino dot org dot uk> <55E625DA dot 7080203 at gmail dot com>
On 09/01/2015 06:25 PM, Martin Sebor wrote:
Having now made this change, I don't think the added complexity
of three declarations and two trivial definitions of the new
c_decl_implicit function across five files is an improvement,
Three declarations? Isn't declaring it in c-common.h enough?
especially since we're still checking for c_dialect_cxx().
(The change simply replaces:
&& (c_dialect_cxx () || !DECL_LANG_FLAG_2 (expr))
with
&& (c_dialect_cxx () || c_decl_implicit (expr))
as suggested.)
Seems like you can do without the check for C++ if you're defining this
function for C++ (to just return false).
I agree with Joseph that the function is better.
+ bool diag /* = true */)
Let's call these parameters "reject_builtin" rather than the generic "diag".
+ function = decay_conversion (function, complain, false);
Please add a comment to "false", e.g. /*reject_builtin*/false
Jason