Don't include <crypt.h> from <stdlib.h> #1112
Merged
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.
This PR tries to re-land #1104, which was closed because I had tried to make a PR directly from my master and messed up.
Except for the branch name, this PR is identical to #1104, so I'm copying the original PR description below verbatim.
POSIX says that crypt() resides in
<unistd.h>
. As far as I know,crypt()
doesn't have anything to do with the C standard library, so including it unconditionally from<stdlib.h>
is somewhat strange and breaks the build of the Lua MD5 implementation bundled with LuaTeX:A simpler test program is just:
It builds successfully with both
gcc
(glibc) andmusl-gcc
(musl), but fails to build withcosmocc
(with an error very similar to the above).Given that
crypt()
is a very short word and is likely to clash with other real-world programs in the future, I suggest removing this include.