This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] Fix unbraced while expr in p-typeprint.c
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFA] Fix unbraced while expr in p-typeprint.c
- From: Pierre Muller <muller at cerbere dot u-strasbg dot fr>
- Date: Wed, 05 Jul 2000 13:55:47 +0200
- References: <395DAF5C.602EC73F@cygnus.com><200006231835.OAA07083@fwr.landmark.com><200006250818.EAA07995@indy.delorie.com><20000630010635.A14862@cygnus.com><200006300846.EAA14373@indy.delorie.com><20000630101845.A5618@cygnus.com><395DAF5C.602EC73F@cygnus.com>
The following patch is needed to get p-typeprint.c to compile correctly.
(I got no warning with cygwin nor djgpp compiler probably because
the preprocessor replace the isdigit into a braced expression !)
This is the kind of unexpected behavior that I really dislike about C
(or more precisely about macros in C).
ChangeLog:
2000-07-05 Pierre Muller <muller@ics.u-strasbg.fr>
* p-typeprint.c (pascal_type_print_method_args): add braces around
isdigit after while keyword.
Index: p-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-typeprint.c,v
retrieving revision 1.1
diff -c -r1.1 p-typeprint.c
*** p-typeprint.c 2000/06/14 12:27:59 1.1
--- p-typeprint.c 2000/07/05 11:47:10
***************
*** 170,180 ****
char *argname;
fputs_filtered (" (", stream);
/* we must demangle this */
! while isdigit
! (physname[0])
{
! while isdigit
! (physname[len])
{
len++;
}
--- 170,178 ----
char *argname;
fputs_filtered (" (", stream);
/* we must demangle this */
! while (isdigit(physname[0]))
{
! while (isdigit(physname[len]))
{
len++;
}
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99