From de928067c545be6ee26565846177ce57fabae769 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 9 Dec 2014 08:00:53 +0000 Subject: improve warnings from rand_r(), rand(), and random() It may take a few iterations to get the tone right. previously discussed with millert --- lib/libc/stdlib/random.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/libc/stdlib/random.c') 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 -- cgit v1.2.3-59-g8ed1b