Quuxplusone added a comment.

I keep seeing patches go by for other targets where they're just implementing 
`random_device` for their target. It doesn't *have* to be based on an actual 
/dev/urandom. You can see all the other options under #ifdefs in this file: 
getentropy, /dev/random, nacl_secure_random, arc4random, rand_s,... If you're 
on a target that doesn't have any of these, then IMO the appropriate patch 
would be one of

- #ifdef _LIBCPP_USING_YOURPLATFORM_RANDOM
- #ifdef _LIBCPP_USING_ALWAYSZERO_RANDOM

where the latter provides a "random_device" that yields nothing but zeroes. 
That would still be very slightly better than providing a non-conforming 
implementation. (And notice that the useless `double random_device::entropy()` 
method will for the first time return a *mathematically correct* value for the 
always-zero random_device! ;))


Repository:
  rCXX libc++

https://reviews.llvm.org/D41316



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to