-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v1.1] Replace usage of rand_r with nrand48 (#817)
This replaces the call to rand_r with nrand48 and changes rand_seed to be an array instead of an unsigned int. With rand_r being deprecated in POSIX 2024, the best replacement is nrand48, which stores its intermediate values as a 48-bit integer in an array of shorts instead of an unsigned int and returns a 32-bit value not constrained by RAND_MAX. nrand48 has been in the POSIX spec. since 2004 and on the large UNIX systems since SVr4. Only things that could be affected are BSDs older than ~2004, but those are presumably old enough that we can ignore them. bin/package test returned with all tests passing (particularly tests/subshell.sh and tests/variables.sh) and monkey testing shows getting and setting RANDOM works.
- Loading branch information
Showing
6 changed files
with
28 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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