This is the mail archive of the gdb@sources.redhat.com 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]

Re: Proper test status if gdb test detects a g++ bug?


On Feb  4, 2001, Michael Elizabeth Chastain <chastain@cygnus.com> wrote:

>   [1] print_addr_of "hairyfunc5(int (*(*)(char *))(long))"

>   [2] print_addr_of "hairyfunc5(int (*)(long) (*)(char *))"

> The argument type string comes from g++ stabs info.

Huh?  All I see here is a demangler error.  [1] is correct, but the
demangler is incorrectly printing [2].

> P. S.  Here is a brief explanation why the arg type is incorrect
>        as written.   A pointer-to-function always has the following type:
>        "returntype (*)(arglist)".

Nope.  It has the form `T = RET (*PTR)(arglist)'.  In this case
`PTR = RET2 (*PTR2)(arglist)'.  Substituting PTR in T, you'll get [1],
not [2].

int hairyfunc5 (PFPc_PFl_i arg) =
int hairyfunc5 (PFl_i (*arg)(char *)) =
int hairyfunc5 (int (*(*arg)(char *))(long))

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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