From owner-cvs-all Sat Feb 24 22:40:17 2001 Delivered-To: cvs-all@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 1BAF837B491; Sat, 24 Feb 2001 22:40:13 -0800 (PST) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.2/8.9.3) id f1P6e0q11960; Sat, 24 Feb 2001 22:40:00 -0800 (PST) (envelope-from dillon) Date: Sat, 24 Feb 2001 22:40:00 -0800 (PST) From: Matt Dillon Message-Id: <200102250640.f1P6e0q11960@earth.backplane.com> To: Bruce Evans Cc: Kris Kennaway , Robert Watson , Nick Sayer , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: ports/astro/xglobe/files patch-random References: Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :.. :> return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); :> } :> :> +__warn_references(rand_r, :> + "warning: rand_r() does not produce high-quality random numbers and should not generally be used"); :... : :No. rand_r() should be generally used because it is standard. It is the :implementor's fault that it is low-quality (unlike for gets(), which is :broken as designed). : :Bruce One of the absolutely most annoying things to me is when I use strftime() with "%y", for a 2-digit year. I really like GCC telling me about missing arguments for printf/scanf format strings. The stupid warning about using a perfectly acceptable '%y' in an strftime() call is inappropriate, though. There is no way to turn it off without also turning off print/scanf missing argument warnings. I agree with Bruce that throwing a warning in for simply using rand() or rand_r() is not appropriate. The man page says its obsolete and that is good enough. We can only protect programmers from themselves to a point, after that we are wasting our time. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message