This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -Wdisallowed-function-list=* (PR c++/39554)
On Thu, Mar 26, 2009 at 10:50 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Mar 25, 2009 at 07:38:39PM -0400, Diego Novillo wrote:
>> On Wed, Mar 25, 2009 at 17:31, Jakub Jelinek <jakub@redhat.com> wrote:
>>
>> > + ? ? ?fnname = IDENTIFIER_POINTER (DECL_NAME (fndecl));
>>
>> How about just using get_name (fndecl)?
>
> get_name sounds like overkill, when we know we have a FUNCTION_DECL. ?Also,
> it wouldn't simplify the function, as instead of testing DECL_NAME
> for non-NULL we'd now have to fnname = get_name (fndecl); and add
> if (fnname == NULL) return; after it. ?I count > 150 uses of
> IDENTIFIER_POINTER (DECL_NAME (...)) in gcc, so this wouldn't be the first
> or last use of it. ?The bigger problem is what Mark said, this kind of name
> comparison doesn't play well with C++.
Can we just make this new warning C only then?
Thanks,
Richard.
> ? ? ? ?Jakub
>