Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Feb 2003 20:57:29 -0800
From:      Kris Kennaway <kris@obsecurity.org>
To:        "Andrey A. Chernov" <ache@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/stdlib rand.c
Message-ID:  <20030217045729.GA68471@rot13.obsecurity.org>
In-Reply-To: <200302170352.h1H3qawJ062671@repoman.freebsd.org>
References:  <200302170352.h1H3qawJ062671@repoman.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Sun, Feb 16, 2003 at 07:52:35PM -0800, Andrey A. Chernov wrote:

>   So, monotonically increased seed->first value correlation problem remains...

I think we should commit this patch (to -current) and fix all the
problems that pop up.  For example, it's used in awk (which started
this set of changes), and in some of the XFree86 libraries.

Kris

Index: stdlib/rand.c
===================================================================
RCS file: /mnt2/ncvs/src/lib/libc/stdlib/rand.c,v
retrieving revision 1.14
diff -u -r1.14 rand.c
--- stdlib/rand.c	5 Feb 2003 21:25:50 -0000	1.14
+++ stdlib/rand.c	8 Feb 2003 06:07:55 -0000
@@ -86,6 +86,8 @@
 #endif  /* !USE_WEAK_SEEDING */
 }
 
+__warn_references(rand_r,
+	"warning: rand_r() does not produce high-quality random numbers and should not generally be used");
 
 int
 rand_r(unsigned int *ctx)
@@ -99,6 +101,9 @@
 
 
 static u_long next = 892053144; /* after srand(1), NSHUFF counted */
+
+__warn_references(rand,
+	"warning: rand() does not produce high-quality random numbers and should not generally be used");
 
 int
 rand()

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+UGu5Wry0BWjoQKURAuzwAJ9HyozHRVACvalkdZOqN5YvxQj4MACfbuAw
kE0FDM79gU9SRFG6GnE6p4c=
=Oqhm
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030217045729.GA68471>