Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2001 22:40:00 -0800 (PST)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Kris Kennaway <kris@obsecurity.org>, Robert Watson <rwatson@FreeBSD.ORG>, Nick Sayer <nsayer@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: ports/astro/xglobe/files patch-random
Message-ID:  <200102250640.f1P6e0q11960@earth.backplane.com>
References:   <Pine.BSF.4.21.0102251713590.5810-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
:..
:>  	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




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