This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix overload resolution of int* vs void*


>>>>> "Sami" == sami wagiaalla <swagiaal@redhat.com> writes:

Sami> A fix for this bug http://sourceware.org/bugzilla/show_bug.cgi?id=10343
Sami> This patch makes it a little bit cheaper to convert a pointer to void*
Sami> than any other pointer conversion.

Consider this test:

    struct B { };
    struct D : public B { };
    void f (void *x) { }
    void f (B *x) { }
    void g(D *x) { f(x); }

This should call f(B*), but with your patch I suspect it will call
f(void*).

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]