groff-commit
[Top][All Lists]
Advanced

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

[groff] 06/19: configure.ac: Add `strdup` to AC_CHECK_FUNCS.


From: G. Branden Robinson
Subject: [groff] 06/19: configure.ac: Add `strdup` to AC_CHECK_FUNCS.
Date: Mon, 8 Nov 2021 18:56:00 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 22a27624ecd9799497104ba1b0856a7264e338b8
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Nov 8 07:28:39 2021 +1100

    configure.ac: Add `strdup` to AC_CHECK_FUNCS.
    
    * configure.ac: Add `strdup` to AC_CHECK_FUNCS since we are using it and
      the whole point of libgroff's `strsave()` was to get along without it.
      But `strdup` has been standardized in POSIX for 20 years (SUSv3,
      POSIX:2001) and is on its way into ISO standard C (N2354) and C++
      (P2391R0) as well.
---
 ChangeLog    | 8 ++++++++
 configure.ac | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d8511fc..a787dc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2021-11-08  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * configure.ac: Add `strdup` to AC_CHECK_FUNCS since we are
+       using it and the whole point of libgroff's `strsave()` was to
+       get along without it.  But `strdup` has been standardized in
+       POSIX for 20 years (SUSv3, POSIX:2001) and is on its way into
+       ISO standard C (N2354) and C++ (P2391R0) as well.
+
+2021-11-08  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * src/libs/libgroff/strsave.cpp (strsave): Call `strcpy()` only
        if `malloc()` did not return a null pointer.  Problem noted by
        Ingo Schwarze.
diff --git a/configure.ac b/configure.ac
index 3e3324a..f9963a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,7 +135,8 @@ LIBS="$LIBS $LIBC $LIBM"
 AC_REPLACE_FUNCS([fmod getcwd putenv strcasecmp \
                   strerror strncasecmp strtol])
 LIBS="$saved_libs"
-AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strsep])
+AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strdup \
+                strsep])
 GROFF_MKSTEMP
 AC_CHECK_DECLS([strsignal, getc_unlocked])
 AC_CHECK_DECLS([sys_siglist, getc_unlocked])



reply via email to

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