build: assume snprintf() in mprintf, drop feature check#20763
build: assume snprintf() in mprintf, drop feature check#20763vszakats wants to merge 1 commit intocurl:masterfrom
snprintf() in mprintf, drop feature check#20763Conversation
This comment was marked as outdated.
This comment was marked as outdated.
snprintf(), drop feature checkssnprintf() in mprintf, drop feature checks
d19237a to
c926f0b
Compare
|
augment review |
🤖 Augment PR SummarySummary: Removes build-time detection/defines for Change: Simplifies 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
This PR simplifies libcurl’s build configuration by assuming snprintf() is available (needed for curl_*printf() float/double formatting) and removing the corresponding feature-detection plumbing.
Changes:
- Make
lib/mprintf.calways usesnprintf()for float/double formatting on non-Windows platforms. - Remove
HAVE_SNPRINTFgeneration from the CMake config header template and Unix cache. - Drop
snprintf()feature checks from both Autotools (configure.ac) and CMake (CMakeLists.txt).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/mprintf.c | Removes the non-snprintf() fallback path for float/double formatting (non-Windows now always uses snprintf()). |
| lib/curl_config-cmake.h.in | Removes the HAVE_SNPRINTF config header define template entry. |
| configure.ac | Stops checking for snprintf() in non-Windows function checks. |
| CMakeLists.txt | Stops checking for snprintf() in non-Windows function checks. |
| CMake/unix-cache.cmake | Removes cached HAVE_SNPRINTF value. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
snprintf() in mprintf, drop feature checkssnprintf() in mprintf, drop feature check
- it is 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, as the code did not check for `HAVE_SNPRINTF` detection variable. - it was already required to build examples. VS2013 and older are known to miss this function, and a fallback is already used.
curl_*printf()float/double support.Source code did not check for
HAVE_SNPRINTFdetection variable.Windows builds stopped using this detection and the function via earlier
commits.
Follow-up to 64f28b8 #20765
Follow-up to 935b1bd #9570 #9569
snprintf()feature check on Windows #20790.