Skip to content

Commit e1bcb79

Browse files
committed
Simplify the checks for snprintf().
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.
1 parent 55dc320 commit e1bcb79

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -421,17 +421,6 @@ else(STDLIBS_HAVE_GETSERVENT)
421421
endif(STDLIBS_HAVE_GETSERVENT)
422422
cmake_pop_check_state()
423423

424-
#
425-
# Make sure we have snprintf(); we require it.
426-
# We use check_symbol_exists(), as it isn't necessarily an external
427-
# function - in Visual Studio, for example, it is an inline function
428-
# calling an external function.
429-
#
430-
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
431-
if(NOT HAVE_SNPRINTF)
432-
message(FATAL_ERROR "snprintf() is required but wasn't found")
433-
endif()
434-
435424
#
436425
# Require a proof of suitable snprintf(3), same as in Autoconf.
437426
#

configure.ac

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,6 @@ AC_LBL_LIBRARY_NET
283283
AC_REPLACE_FUNCS(strlcat strlcpy strsep getservent getopt_long)
284284
AC_CHECK_FUNCS(fork vfork)
285285

286-
#
287-
# Make sure we have snprintf(); we require it.
288-
#
289-
AC_CHECK_FUNC(snprintf,,
290-
AC_MSG_ERROR([snprintf() is required but wasn't found]))
291-
292286
#
293287
# It became apparent at some point that using a suitable C99 compiler does not
294288
# automatically mean snprintf(3) implementation in the libc supports all the

0 commit comments

Comments
 (0)