This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: FIXINCL goes into an infinite loop on alpha-osf4


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] == '/'))


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