mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
build: assume snprintf() in mprintf, drop feature check
- it was already required for `curl_*printf()` float/double support. - some curl tests always fail without it. - it was already assumed to be present to build test servers. Source code did not check for `HAVE_SNPRINTF` detection variable. - it was already required to build examples. Windows builds stopped using this detection and the function via earlier commits. Follow-up to64f28b8f88#20765 Follow-up to935b1bd454#9570 #9569 Closes #20763
This commit is contained in:
parent
89043ba906
commit
a8bc4cbcfe
5 changed files with 1 additions and 10 deletions
|
|
@ -228,7 +228,6 @@ set(HAVE_SIGACTION 1)
|
||||||
set(HAVE_SIGINTERRUPT 1)
|
set(HAVE_SIGINTERRUPT 1)
|
||||||
set(HAVE_SIGNAL 1)
|
set(HAVE_SIGNAL 1)
|
||||||
set(HAVE_SIGSETJMP 1)
|
set(HAVE_SIGSETJMP 1)
|
||||||
set(HAVE_SNPRINTF 1)
|
|
||||||
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
|
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
|
||||||
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
|
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
|
||||||
set(HAVE_SOCKET 1)
|
set(HAVE_SOCKET 1)
|
||||||
|
|
|
||||||
|
|
@ -1636,7 +1636,6 @@ if(NOT WIN32)
|
||||||
check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # net/if.h
|
check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # net/if.h
|
||||||
check_function_exists("realpath" HAVE_REALPATH)
|
check_function_exists("realpath" HAVE_REALPATH)
|
||||||
check_function_exists("sched_yield" HAVE_SCHED_YIELD)
|
check_function_exists("sched_yield" HAVE_SCHED_YIELD)
|
||||||
check_function_exists("snprintf" HAVE_SNPRINTF) # to match detection method in ./configure
|
|
||||||
check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP)
|
check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP)
|
||||||
check_symbol_exists("stricmp" "string.h" HAVE_STRICMP)
|
check_symbol_exists("stricmp" "string.h" HAVE_STRICMP)
|
||||||
check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI)
|
check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI)
|
||||||
|
|
|
||||||
|
|
@ -4198,7 +4198,6 @@ if test "$curl_cv_native_windows" != "yes"; then
|
||||||
if_nametoindex \
|
if_nametoindex \
|
||||||
realpath \
|
realpath \
|
||||||
sched_yield \
|
sched_yield \
|
||||||
snprintf \
|
|
||||||
])
|
])
|
||||||
CURL_CHECK_FUNC_INET_NTOP
|
CURL_CHECK_FUNC_INET_NTOP
|
||||||
CURL_CHECK_FUNC_INET_PTON
|
CURL_CHECK_FUNC_INET_PTON
|
||||||
|
|
|
||||||
|
|
@ -502,9 +502,6 @@
|
||||||
/* Define to 1 if you have the sigsetjmp function or macro. */
|
/* Define to 1 if you have the sigsetjmp function or macro. */
|
||||||
#cmakedefine HAVE_SIGSETJMP 1
|
#cmakedefine HAVE_SIGSETJMP 1
|
||||||
|
|
||||||
/* Define to 1 if you have the `snprintf' function. */
|
|
||||||
#cmakedefine HAVE_SNPRINTF 1
|
|
||||||
|
|
||||||
/* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */
|
/* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */
|
||||||
#cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
#cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -678,14 +678,11 @@ static bool out_double(void *userp,
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
curlx_win32_snprintf(work, BUFFSIZE, fmt, dnum);
|
curlx_win32_snprintf(work, BUFFSIZE, fmt, dnum);
|
||||||
#elif defined(HAVE_SNPRINTF)
|
#else
|
||||||
/* !checksrc! disable BANNEDFUNC 1 */
|
/* !checksrc! disable BANNEDFUNC 1 */
|
||||||
/* !checksrc! disable LONGLINE */
|
/* !checksrc! disable LONGLINE */
|
||||||
/* NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling) */
|
/* NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling) */
|
||||||
snprintf(work, BUFFSIZE, fmt, dnum);
|
snprintf(work, BUFFSIZE, fmt, dnum);
|
||||||
#else
|
|
||||||
/* float and double outputs do not work without snprintf support */
|
|
||||||
work[0] = 0;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef CURL_HAVE_DIAG
|
#ifdef CURL_HAVE_DIAG
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue