* [RFA] testsuite/gdb.c++/cplusfuncs.cc: remove superfluous casts
@ 2001-05-31 13:35 Michael Elizabeth Chastain
2001-05-31 14:18 ` Fernando Nasser
0 siblings, 1 reply; 2+ messages in thread
From: Michael Elizabeth Chastain @ 2001-05-31 13:35 UTC (permalink / raw)
To: gdb-patches
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?
Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"
===
2001-05-31 Michael Chastain <chastain@redhat.com>
* 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; }
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFA] testsuite/gdb.c++/cplusfuncs.cc: remove superfluous casts
2001-05-31 13:35 [RFA] testsuite/gdb.c++/cplusfuncs.cc: remove superfluous casts Michael Elizabeth Chastain
@ 2001-05-31 14:18 ` Fernando Nasser
0 siblings, 0 replies; 2+ messages in thread
From: Fernando Nasser @ 2001-05-31 14:18 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: gdb-patches
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
> <chastain@redhat.com>
> "love without fear"
>
> ===
>
> 2001-05-31 Michael Chastain <chastain@redhat.com>
>
> * 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-05-31 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-31 13:35 [RFA] testsuite/gdb.c++/cplusfuncs.cc: remove superfluous casts Michael Elizabeth Chastain
2001-05-31 14:18 ` Fernando Nasser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox