From owner-cvs-all Sat Feb 24 23:50:26 2001 Delivered-To: cvs-all@freebsd.org Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (Postfix) with ESMTP id 565AD37B401; Sat, 24 Feb 2001 23:50:22 -0800 (PST) (envelope-from j@uriah.heep.sax.de) Received: (from uucp@localhost) by sax.sax.de (8.9.3/8.9.3) with UUCP id IAA16649; Sun, 25 Feb 2001 08:50:21 +0100 (CET) Received: (from j@localhost) by uriah.heep.sax.de (8.9.3/8.9.3) id IAA21887; Sun, 25 Feb 2001 08:43:55 +0100 (MET) (envelope-from j) Date: Sun, 25 Feb 2001 08:43:54 +0100 From: J Wunsch To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: ports/astro/xglobe/files patch-random Message-ID: <20010225084353.A21830@uriah.heep.sax.de> Reply-To: Joerg Wunsch References: <200102250306.f1P36eY37040@freefall.freebsd.org> <20010224202345.A15392@mollari.cthul.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20010224202345.A15392@mollari.cthul.hu>; from kris@obsecurity.org on Sat, Feb 24, 2001 at 08:23:45PM -0800 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As Kris Kennaway wrote: > How about this also: > static u_long next = 1; > + > +__warn_references(rand, > + "warning: rand() does not produce high-quality random numbers and should not generally be used"); Objected. rand() is the ANSI/ISO interface, random() is non-standard und thus unportable. Standard and portable programs should not cause warnings. The IMHO better way would be to make rand() use random()'s algorithm, while retaining the standard-mandated calling interface. Ship the existing rand()/srand() functions either as orand()/osrand() or perhaps in libcompat for those who insist that they need the old algorithm for 20-year old regression test scripts to behave predictably the same way they did all the previous 20 years. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message