rand is not ISO C compliant in Cygwin
Bruno Haible
bruno@clisp.org
Fri Nov 10 22:27:49 GMT 2023
Norton Allen wrote:
> Cygwin/(newlib?) has chosen to avoid race conditions by making
> pseudo-random sequences in different threads independent. Although the
> standard does not require this, it does not prohibit it either.
I disagree. I cited the relevant sentences from the standard.
Other platforms (glibc, Android) avoid race conditions in rand()
by locking. Which is compliant with the standard.
Bruno
More information about the Cygwin
mailing list