bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

remove.c patch needed to compile CVS cor3eutils with GCC 4.0.2


From: Paul Eggert
Subject: remove.c patch needed to compile CVS cor3eutils with GCC 4.0.2
Date: Tue, 22 Nov 2005 13:49:19 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I didn't install this since I figured remove.c might still be
mutating, and I'm not sure what the assert was supposed to check.

Also, I assumed you wanted to use only declaration-after-statement
C99, not 'for (declaration ...'  C99, since only the former is
commonly supported in pre-C99 compilers, but I thought I'd ask to make
sure.

2005-11-22  Paul Eggert  <address@hidden>

        * src/remove.c (AD_push): Remove assert that doesn't compile.
        (rm): Don't assume C99 for (int i = ..., since GCC 4.0.2 rejects
        it in default mode.

--- remove.c.~1.137.~   2005-11-22 13:08:25.000000000 -0800
+++ remove.c    2005-11-22 13:41:39.000000000 -0800
@@ -574,7 +574,6 @@ AD_push (int fd_cwd, Dirstack_state *ds,
 
   /* Extend the stack.  */
   obstack_blank (&ds->Active_dir, sizeof (struct AD_ent));
-  assert (AD_stack_height (ds) == n_lengths + 1);
 
   /* Fill in the new values.  */
   top = AD_stack_top (ds);
@@ -1361,8 +1360,9 @@ rm (size_t n_files, char const *const *f
   enum RM_status status = RM_OK;
   Dirstack_state *ds = ds_init ();
   bool cwd_restore_failed = false;
+  size_t i;
 
-  for (size_t i = 0; i < n_files; i++)
+  for (i = 0; i < n_files; i++)
     {
       if (cwd_restore_failed && IS_RELATIVE_FILE_NAME (file[i]))
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]