build: tidy up and dedupe strdup functions#20497
Closed
vszakats wants to merge 25 commits intocurl:masterfrom
Closed
build: tidy up and dedupe strdup functions#20497vszakats wants to merge 25 commits intocurl:masterfrom
strdup functions#20497vszakats wants to merge 25 commits intocurl:masterfrom
Conversation
44db2b7 to
65d4335
Compare
Revert "dynbuf.c drop reference to deleted curlx_saferealloc" This reverts commit 1dcbbf9.
strdup functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CURLX_STRDUP_LOW()for mappingstrdup(), and to do it atone place within the code, in
curl_setup.h.curlx_strdup(). (Also to fix building withouta system
strdup().)HAVE_STRDUP.HAVE_STRDUPon Windows.HAVE_STRDUP.tests/serveruses strdup without checkingHAVE_STRDUP.My assessment is that this was the case for a long time, but only became apparent via a bare
grepafter 193cb00 build: stop overriding standard memory allocation functions #19626.edit: confirmed that in 8.17 curl and libcurl built without strdup, but tests and examples did not.
HAVE_STRDUPto deparate PR.strdup(deducting fromconfig-mac.h, which missed settingHAVE_STRDUP). 919c97f. edit: classic mac includesextra/strdup.h, so it also has one.Separate PRs:
Curl_saferealloc()function.Unused since 67ae101 http: unfold response headers earlier #19949 → curlx: drop unused
curlx_saferealloc()#20504strdup()C function, drop feature detection.curl did not build without a system
strdup()for probably a goodwhile. This became apparent (with a grep) after
193cb00 build: stop overriding standard memory allocation functions #19626.
Let us know if this causes an issue. → build: require POSIX
strdup()#20505