by avar · 9y ago · 0 comments
A weak random number generator that usually powers rand() is also usually faster and takes less CPU to run.
Both of these things were thought to be more important in more innocent times when C was standardized.
OpenBSD's decision makes sense on balance, it gives some security to otherwise insecure programs by default, the trade-off is breaking programs written against the C standard which make assumptions about the documented rand() behavior.
One thing to note though, different platforms don't necessarily implement the rand() function the same way, the standard does not define an algorithm for it, so unless you want your tests to run differently on every different C library it might not be the best idea to begin with.