Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Feb 2003 16:54:32 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        "Jacques A. Vidrine" <nectar@FreeBSD.ORG>
Cc:        Tim Robbins <tjr@FreeBSD.ORG>, Kris Kennaway <kris@obsecurity.org>, "Andrey A. Chernov" <ache@FreeBSD.ORG>, current@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libc/stdlib rand.c
Message-ID:  <20030218005432.GA9793@HAL9000.homeunix.com>
In-Reply-To: <20030217130531.GA11276@madman.celabo.org>
References:  <200302170352.h1H3qawJ062671@repoman.freebsd.org> <20030217045729.GA68471@rot13.obsecurity.org> <20030217164048.A28273@dilbert.robbins.dropbear.id.au> <20030217130531.GA11276@madman.celabo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Jacques A. Vidrine <nectar@FreeBSD.ORG>:
> On Mon, Feb 17, 2003 at 04:40:48PM +1100, Tim Robbins wrote:
> > I disagree. It's safe to use rand() in games and in certain kinds of
> > simulations when you don't care that the distribution isn't quite
> > uniform,
> 
> Safe, maybe.  But I think it still shouldn't be used.
> See my posting of two years ago:
> 
> <URL: http://groups.google.com/groups?&selm=97b83t%2414q3%241%40FreeBSD.csie.NCTU.edu.tw&rnum=1 >
> 
> BTW, I don't care if linking a program with rand() gives an obnoxious
> warning or not.  Just pointing out that rand() is less useful than it
> might seem.

Yes, as with most interfaces, there are ways to use rand()
incorrectly.  But there also exist ways to use it correctly.
That's why people would get annoyed if their programs that
have compiled for years start coughing up spurious warnings.
rand() is not like gets(); it is almost impossible to use
the latter in a robust program.  On the other hand, I like
the idea of people going out and fixing all the programs that
use rand() incorrectly.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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