This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ 14561] Separate rand and random seeds.


On Thu, May 23, 2013 at 12:29:22PM -0700, Roland McGrath wrote:
> I see no reason to think that this change is desireable.

The current behavior is non-conforming. Consider the program:

int main(int argc, char **argv)
{
	srand(1);
	printf("%d\n", rand());
	if (argc>1) srandom(1);
	printf("%d\n", rand());
}

This program is required by the standard to print the same results
regardless of the number of arguments passed. Presently, it does not.

Other better examples of non-conformance can be constructed if you
care.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]