summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/random.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-12-09 08:00:53 +0000
committerderaadt <deraadt@openbsd.org>2014-12-09 08:00:53 +0000
commitde928067c545be6ee26565846177ce57fabae769 (patch)
treec14d9f61c4e0347e1564cbbead8cc81c3fecf9f5 /lib/libc/stdlib/random.c
parentIn ingo's new world order, we do not want multiple manual pages describing (diff)
downloadwireguard-openbsd-de928067c545be6ee26565846177ce57fabae769.tar.xz
wireguard-openbsd-de928067c545be6ee26565846177ce57fabae769.zip
improve warnings from rand_r(), rand(), and random()
It may take a few iterations to get the tone right. previously discussed with millert
Diffstat (limited to 'lib/libc/stdlib/random.c')
-rw-r--r--lib/libc/stdlib/random.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c
index cba088c7514..375bfbd0e67 100644
--- a/lib/libc/stdlib/random.c
+++ b/lib/libc/stdlib/random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: random.c,v 1.25 2014/12/08 21:45:20 deraadt Exp $ */
+/* $OpenBSD: random.c,v 1.26 2014/12/09 08:00:53 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
@@ -415,3 +415,8 @@ random(void)
UNLOCK();
return r;
}
+
+#if defined(APIWARN)
+__warn_references(rand,
+ "warning: random() may return determinstic values, is that what you want?");
+#endif