]> The Tcpdump Group git mirrors - tcpdump/commitdiff
configure, CMakeLists.txt: don't check for snprintf().
authorGuy Harris <[email protected]>
Mon, 30 Jan 2023 20:46:44 +0000 (12:46 -0800)
committerGuy Harris <[email protected]>
Mon, 30 Jan 2023 20:46:44 +0000 (12:46 -0800)
It's specified by the C90 standard (and, as I remember, by the C89
standard, although I no longer have my paper copy); no need to worry
about ancient environments that lack it, and we have some cases where we
call it in code not protected by #ifdef HAVE_STRFTIME/#endif and haven't
seen any reports of problems.

CMakeLists.txt
cmakeconfig.h.in
config.h.in
configure
configure.ac
ntp.c
print-ntp.c
print-zep.c

index bca3e9b1567070eb8e95a5c17761246a52caf406..635c430aa1e116bfbc28e9adef47d9d7cdb8b858 100644 (file)
@@ -416,7 +416,6 @@ if(NOT HAVE_SNPRINTF)
 endif()
 
 check_function_exists(getopt_long HAVE_GETOPT_LONG)
-check_function_exists(strftime HAVE_STRFTIME)
 check_function_exists(setlinebuf HAVE_SETLINEBUF)
 #
 # For Windows,  don't need to waste time checking for fork() or vfork().
index 9bd23d7ad9d17fc7605dc48a3ef78945969da13f..d008c794981cf67f97d6d51a1a6d13f25a830492 100644 (file)
 /* Define to 1 if you have the `pcap_dump_flush' function. */
 #cmakedefine HAVE_PCAP_DUMP_FLUSH 1
 
-/* define if libpcap has pcap_dump_ftell() */
+/* Define to 1 if you have the `pcap_dump_ftell' function. */
 #cmakedefine HAVE_PCAP_DUMP_FTELL 1
 
 /* Define to 1 if you have the `pcap_dump_ftell64' function. */
 /* Define to 1 if you have the `strdup' function. */
 #cmakedefine HAVE_STRDUP 1
 
-/* Define to 1 if you have the `strftime' function. */
-#cmakedefine HAVE_STRFTIME 1
-
 /* Define to 1 if you have the <strings.h> header file. */
 #cmakedefine HAVE_STRINGS_H 1
 
index afe0dc2e8e1dbb3c2f8f81c653447609d66c4fe7..ada6aad950dbf345f39b7b6e12bf4b41ab0357ad 100644 (file)
 /* Define to 1 if you have the `strdup' function. */
 #undef HAVE_STRDUP
 
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
index 8ebb37e54606ada60dfc9ebc8aff5768394db858..5a909b567b797d0c7f93ed1abb7d2e7313913bf6 100755 (executable)
--- a/configure
+++ b/configure
@@ -5178,7 +5178,7 @@ esac
 fi
 
 
-for ac_func in fork vfork strftime
+for ac_func in fork vfork
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
index fccebbcd0741929c1e63fe53e604cd9ebeb88721..0278e7c5cd77a564c464040430d97b3afbdd7caf 100644 (file)
@@ -407,7 +407,7 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
 fi
 
 AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long)
-AC_CHECK_FUNCS(fork vfork strftime)
+AC_CHECK_FUNCS(fork vfork)
 AC_CHECK_FUNCS(setlinebuf)
 
 #
diff --git a/ntp.c b/ntp.c
index 4d17932ffdf69a58481c08acc45462f5ffa5bb89..10fabe4b6d13575b4578f78ec33cfb1497cb8ea2 100644 (file)
--- a/ntp.c
+++ b/ntp.c
@@ -48,7 +48,6 @@ p_ntp_time(netdissect_options *ndo,
        f = (uint32_t)(ff * 1000000000.0);      /* treat fraction as parts per billion */
        ND_PRINT("%u.%09u", i, f);
 
-#ifdef HAVE_STRFTIME
        /*
         * print the UTC time in human-readable format.
         */
@@ -81,5 +80,4 @@ p_ntp_time(netdissect_options *ndo,
                }
            }
        }
-#endif
 }
index 86e29e69330e163d5274a2a5fdddfd7aa81e5a62..499585fd1dfe44bd6c92b48954a45796a8181dce 100644 (file)
@@ -38,9 +38,7 @@
 
 #include "netdissect-stdinc.h"
 
-#ifdef HAVE_STRFTIME
 #include <time.h>
-#endif
 
 #define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
index 7186f74aaaf48f9d752df3cedf9423de08f53ef7..da1e91c7d2122394803e3fa64924b5293ad934e6 100644 (file)
@@ -77,7 +77,6 @@ static void zep_print_ts(netdissect_options *ndo, const u_char *p)
                                                billion */
        ND_PRINT("%u.%09d", i, f);
 
-#ifdef HAVE_STRFTIME
        /*
         * print the time in human-readable format.
         */
@@ -90,7 +89,6 @@ static void zep_print_ts(netdissect_options *ndo, const u_char *p)
                strftime(time_buf, sizeof (time_buf), "%Y/%m/%d %H:%M:%S", tm);
                ND_PRINT(" (%s)", time_buf);
        }
-#endif
 }
 
 /*