Configure: don't probe for the malloc()/free() return type #20806
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.
We require a C99 compiler, or in the case that led to this commit, a C++ compiler, and for those the malloc() and free() return types are well defined.
This probe broke on Solaris when building with g++.
Unlike glibc, the libc headers on Solaris, when building using a C++ compiler, define the stdlib.h functions within the std:: namespace, then imports those names into the top level namespace with 'using std::malloc'.
This conflicts with the declarations used in the probe, causing the probe to fail to build, despite malloc() actually returning a void *.
Since these two functions have well defined return types according to the standard, assume their return values match.
Configure can still be invoked with different definitions for malloctype and freetype, or hints can override them, so someone on a non-standard system can at least get past this if they really need to (such a system will likely not build perl anyway.)