bug-findutils
[Top][All Lists]
Advanced

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

build fixes and clean-up


From: Jim Meyering
Subject: build fixes and clean-up
Date: Tue, 18 Sep 2012 12:20:30 +0200

Hi,

To investigate the leaks reported in http://savannah.gnu.org/bugs/?37356
I tried to build from source using a modern automake.
That failed because the AM_C_PROTOTYPES macro is officially obsolete.
The first patch simply removes the use of that macro.

The second failure was because find was requiring a file,
build-aux/missing, that has been removed from gnulib.
Similarly, the second patch just removes it from the list.

Finally, while investigating the leaks, I cleaned up some nits.
Here are the patches:

      build: stop using now-obsolete macro, AM_C_PROTOTYPES
      build: avoid import-gnulib.sh failure
      find: minor tweaks

>From adb5b90eeb47bf74754ee5a7c9dbddc78f921c28 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 18 Sep 2012 11:42:23 +0200
Subject: [PATCH 1/3] build: stop using now-obsolete macro, AM_C_PROTOTYPES

* configure.ac: Don't use obsolete AM_C_PROTOTYPES.
---
 ChangeLog    | 5 +++++
 configure.ac | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f240a6..1f8806d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-18  Jim Meyering  <address@hidden>
+
+       build: stop using now-obsolete macro, AM_C_PROTOTYPES
+       * configure.ac: Don't use obsolete AM_C_PROTOTYPES.
+
 2011-12-30  Karl Berry  <address@hidden>

        Documentation improvements (UK spelling, use of @code).
diff --git a/configure.ac b/configure.ac
index 5ed3e91..3b42f32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,8 +77,6 @@ AC_PROG_CPP
 dnl for gnulib
 gl_EARLY

-AM_C_PROTOTYPES
-
 AC_PROG_INSTALL
 AC_PROG_RANLIB
 dnl AC_PROG_LIBTOOL
-- 
1.7.12.503.g5976753


>From 154b0988b97482a2b57dc5d577a36f9045d89229 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 18 Sep 2012 11:43:27 +0200
Subject: [PATCH 2/3] build: avoid import-gnulib.sh failure

* import-gnulib.config (extra_files): Remove build-aux/missing,
since that file has been removed from gnulib.
---
 ChangeLog            | 4 ++++
 import-gnulib.config | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 1f8806d..8d636aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-09-18  Jim Meyering  <address@hidden>

+       build: avoid import-gnulib.sh failure
+       * import-gnulib.config (extra_files): Remove build-aux/missing,
+       since that file has been removed from gnulib.
+
        build: stop using now-obsolete macro, AM_C_PROTOTYPES
        * configure.ac: Don't use obsolete AM_C_PROTOTYPES.

diff --git a/import-gnulib.config b/import-gnulib.config
index 7419906..092c8ad 100644
--- a/import-gnulib.config
+++ b/import-gnulib.config
@@ -8,7 +8,6 @@ build-aux/depcomp
 build-aux/install-sh
 build-aux/mdate-sh
 build-aux/mkinstalldirs
-build-aux/missing
 build-aux/texinfo.tex
 '

-- 
1.7.12.503.g5976753


>From a2927b2e41c9dc9e1e35991cbca90889d7550893 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 18 Sep 2012 11:45:38 +0200
Subject: [PATCH 3/3] find: minor tweaks

* find/print.c (do_time_format): Use memcpy in place of sprintf.
When calling x2nrealloc, use "sizeof *buf" as the element size,
rather than "2u".
---
 ChangeLog    | 5 +++++
 find/print.c | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8d636aa..5f1158d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-09-18  Jim Meyering  <address@hidden>

+       find: minor tweaks
+       * find/print.c (do_time_format): Use memcpy in place of sprintf.
+       When calling x2nrealloc, use "sizeof *buf" as the element size,
+       rather than "2u".
+
        build: avoid import-gnulib.sh failure
        * import-gnulib.config (extra_files): Remove build-aux/missing,
        since that file has been removed from gnulib.
diff --git a/find/print.c b/find/print.c
index a918da6..5d35172 100644
--- a/find/print.c
+++ b/find/print.c
@@ -493,7 +493,8 @@ do_time_format (const char *fmt, const struct tm *p, const 
char *ns, size_t ns_s
    * case.
    */
   timefmt = xmalloc (strlen (fmt) + 2u);
-  sprintf (timefmt, "_%s", fmt);
+  timefmt[0] = '_';
+  memcpy (timefmt + 1, fmt, strlen (fmt) + 1);

   /* altered_time is a similar time, but in which both
    * digits of the seconds field are different.
@@ -569,7 +570,7 @@ do_time_format (const char *fmt, const struct tm *p, const 
char *ns, size_t ns_s
        }
       else
        {
-         buf = x2nrealloc (buf, &buf_size, 2u);
+         buf = x2nrealloc (buf, &buf_size, sizeof *buf);
        }
     }
 }
-- 
1.7.12.503.g5976753


reply via email to

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