From owner-freebsd-current Sun Feb 16 20:57:35 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0D6F37B401; Sun, 16 Feb 2003 20:57:32 -0800 (PST) Received: from obsecurity.dyndns.org (adsl-63-207-60-52.dsl.lsan03.pacbell.net [63.207.60.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C9B343FCB; Sun, 16 Feb 2003 20:57:30 -0800 (PST) (envelope-from kris@obsecurity.org) Received: from rot13.obsecurity.org (rot13.obsecurity.org [10.0.0.5]) by obsecurity.dyndns.org (Postfix) with ESMTP id C17AE679DA; Sun, 16 Feb 2003 20:57:29 -0800 (PST) Received: by rot13.obsecurity.org (Postfix, from userid 1000) id 9A62710FE; Sun, 16 Feb 2003 20:57:29 -0800 (PST) Date: Sun, 16 Feb 2003 20:57:29 -0800 From: Kris Kennaway To: "Andrey A. Chernov" Cc: current@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/stdlib rand.c Message-ID: <20030217045729.GA68471@rot13.obsecurity.org> References: <200302170352.h1H3qawJ062671@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <200302170352.h1H3qawJ062671@repoman.freebsd.org> User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 16, 2003 at 07:52:35PM -0800, Andrey A. Chernov wrote: > So, monotonically increased seed->first value correlation problem remai= ns... 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 */ } =20 +__warn_references(rand_r, + "warning: rand_r() does not produce high-quality random numbers and shoul= d not generally be used"); =20 int rand_r(unsigned int *ctx) @@ -99,6 +101,9 @@ =20 =20 static u_long next =3D 892053144; /* after srand(1), NSHUFF counted */ + +__warn_references(rand, + "warning: rand() does not produce high-quality random numbers and should = not generally be used"); =20 int rand() --5vNYLRcllDrimb99 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+UGu5Wry0BWjoQKURAuzwAJ9HyozHRVACvalkdZOqN5YvxQj4MACfbuAw kE0FDM79gU9SRFG6GnE6p4c= =Oqhm -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message