From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Michael Elizabeth Chastain Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] testsuite/gdb.c++/cplusfuncs.cc: remove superfluous casts Date: Thu, 31 May 2001 14:18:00 -0000 Message-id: <3B16B527.F27F5120@cygnus.com> References: <200105312041.NAA12102@bosch.cygnus.com> X-SW-Source: 2001-05/msg00510.html Michael Elizabeth Chastain wrote: > > Here is a small patch to remove some superfluous casts from > testsuite/gdb.c++/cplusfuncs.cc. > > The casts are in a group of marker functions whose purpose is to help > figure out which demangler is in use (v2 or v3). When I originally wrote > these marker functions, I made all the return types 'int' for uniformity. > This uniformity is actually not needed; the test script is not even > looking at this return type. And it involves some pointer->integer > casts which cause problems on some platforms. > > Testing: I tested this on native Red Hat Linux 7 and native Solaris 2.8, > with both gcc 2.95.3 and gcc 3pre 2001-05-25. Kevin Buettner tested > on ia64-unknown-linux with gcc 2.96. > > OK to apply? > Sure. Thanks. Fernando > Michael Elizabeth Chastain > > "love without fear" > > === > > 2001-05-31 Michael Chastain > > * gdb.c++/cplusfuncs.cc (dm_type_char_star): Remove superfluous cast. > (dm_type_int_star): Likewise. > (dm_type_long_star): Likewise. > (dm_type_void_star): Likewise. > > === > > Index: gdb/testsuite/gdb.c++/cplusfuncs.cc > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/cplusfuncs.cc,v > retrieving revision 1.2 > diff -c -3 -p -r1.2 cplusfuncs.cc > *** gdb/testsuite/gdb.c++/cplusfuncs.cc 2001/02/14 19:54:04 1.2 > --- gdb/testsuite/gdb.c++/cplusfuncs.cc 2001/05/31 19:43:38 > *************** int hairyfunc7 (PFPFPc_i_PFl_i arg) { > *** 187,196 **** > /* gdb has two demanglers (one for g++ 2.95, one for g++ 3). > These marker functions help me figure out which demangler is in use. */ > > ! int dm_type_char_star (char * p) { return (int) p; } > int dm_type_foo_ref (foo & foo) { return foo.ifoo; } > ! int dm_type_int_star (int * p) { return (int) p; } > ! int dm_type_long_star (long * p) { return (int) p; } > int dm_type_unsigned_int (unsigned int i) { return i; } > int dm_type_void (void) { return 0; } > ! int dm_type_void_star (void * p) { return (int) p; } > --- 187,196 ---- > /* gdb has two demanglers (one for g++ 2.95, one for g++ 3). > These marker functions help me figure out which demangler is in use. */ > > ! char * dm_type_char_star (char * p) { return p; } > int dm_type_foo_ref (foo & foo) { return foo.ifoo; } > ! int * dm_type_int_star (int * p) { return p; } > ! long * dm_type_long_star (long * p) { return p; } > int dm_type_unsigned_int (unsigned int i) { return i; } > int dm_type_void (void) { return 0; } > ! void * dm_type_void_star (void * p) { return p; } -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9