This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: FIXINCL goes into an infinite loop on alpha-osf4
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: FIXINCL goes into an infinite loop on alpha-osf4
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Sat, 22 Jan 2000 12:55:34 -0800
- Cc: egcs-bugs at egcs dot cygnus dot com, egcs-patches at egcs dot cygnus dot com, autogen at linuxbox dot com
- References: <200001221930.OAA11326@caip.rutgers.edu> <20000122124137.A12229@wolery.cumb.org>
On Sat, Jan 22, 2000 at 12:41:37PM -0800, Zack Weinberg wrote:
> On Sat, Jan 22, 2000 at 02:30:36PM -0500, Kaveh R. Ghazi wrote:
> > I tried turning on DO_STATS/DEBUG, but then fixincl.c wouldn't
> > compile:
> >
> > > cc: Error: ../../../egcs-CVS20000121/gcc/fixinc/fixincl.c, line 1149:
> > > In this statement, "pz_fname" is not declared.
> > > fprintf (stderr, z_failed, p_fixd->fix_name, pz_fname,
[...]
> I'll look at this.
Obvious bug with obvious fix - below, committed.
Note that to get DO_STATS to do anything useful, you must also define
NO_BOGOSITY. (Bruce, what's the story with NO_BOGOSITY?)
zw
* fixinc/fixincl.c: Move declarations of 'pz_fname' and
'pz_scan' into scope of entire function. Only affects
compiles with -DDEBUG.
===================================================================
Index: fixincl.c
--- fixincl.c 2000/01/17 21:45:29 1.24
+++ fixincl.c 2000/01/22 20:52:55
@@ -1089,6 +1089,8 @@ fix_applies (p_fixd)
#ifdef DEBUG
static const char z_failed[] = "not applying %s to %s - test %d failed\n";
#endif
+ const char *pz_fname = pz_curr_file;
+ const char *pz_scan = p_fixd->file_list;
int test_ct;
tTestDesc *p_test;
@@ -1098,10 +1100,8 @@ fix_applies (p_fixd)
/* IF there is a file name restriction,
THEN ensure the current file name matches one in the pattern */
- if (p_fixd->file_list != (char *) NULL)
+ if (pz_scan != (char *) NULL)
{
- const char *pz_fname = pz_curr_file;
- const char *pz_scan = p_fixd->file_list;
size_t name_len;
while ((pz_fname[0] == '.') && (pz_fname[1] == '/'))