]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Simplify the checks for snprintf().
authorDenis Ovsienko <[email protected]>
Wed, 27 Mar 2024 20:11:20 +0000 (20:11 +0000)
committerGuy Harris <[email protected]>
Mon, 16 Dec 2024 01:15:44 +0000 (17:15 -0800)
Do not check that the function is just available: first, it is in C99,
so the check almost certainly is a waste of time; second, the source
requires the function unconditionally; third, the subsequent "snprintf()
is suitable" check implies the "snprintf() is available" part anyway.

(cherry picked from commit e1bcb7941d916285e5e502ff84dff5a15ec0b498)

CMakeLists.txt
configure.ac

index a5c2c88346c5b8cc65f8bdf682a58cbcb6b3aa0f..9de318a28c82402887247903c638284b61c82b8a 100644 (file)
@@ -500,17 +500,6 @@ else(STDLIBS_HAVE_GETSERVENT)
 endif(STDLIBS_HAVE_GETSERVENT)
 cmake_pop_check_state()
 
-#
-# Make sure we have snprintf(); we require it.
-# We use check_symbol_exists(), as it isn't necessarily an external
-# function - in Visual Studio, for example, it is an inline function
-# calling an external function.
-#
-check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
-if(NOT HAVE_SNPRINTF)
-    message(FATAL_ERROR "snprintf() is required but wasn't found")
-endif()
-
 #
 # Require a proof of suitable snprintf(3), same as in Autoconf.
 #
index 1f2e4d7854a061c448d59070c1d9e31bb3ab641f..510b2624e87c9ba4a4cf5d9ed995add4cbc8061b 100644 (file)
@@ -445,12 +445,6 @@ AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long)
 AC_CHECK_FUNCS(fork vfork)
 AC_CHECK_FUNCS(setlinebuf)
 
-#
-# Make sure we have snprintf(); we require it.
-#
-AC_CHECK_FUNC(snprintf,,
-    AC_MSG_ERROR([snprintf() is required but wasn't found]))
-
 #
 # It became apparent at some point that using a suitable C99 compiler does not
 # automatically mean snprintf(3) implementation in the libc supports all the