AVR C Runtime Library - Bugs: bug #18662, rand() keeps returning the same...
You are not allowed to post comments on this tracker with your current authentication level.
bug #18662: rand() keeps returning the same value if seeded with 0
Submitter: | Roland Bluethgen <calocybe> | ||
Submitted: | Sun 31 Dec 2006 01:57:10 PM UTC | ||
Category: | Library | Severity: | 4 - Important |
Priority: | 7 - High | Item Group: | libc code |
Status: | Fixed | Assigned to: | joerg_wunsch |
Percent Complete: | 0% | Open/Closed: | Closed |
Release: | None | Fixed Release: | None |
Mon 08 Jan 2007 02:10:19 PM UTC, comment #1: |
Joerg Wunsch <joerg_wunsch> |
Sun 31 Dec 2006 01:57:10 PM UTC, original submission:
The function do_rand() in rand.c, invoked by rand(), keeps returning the same value, in particular RAND_MAX, if the static variable 'next' is seeded with srand(0).
|
Roland Bluethgen <calocybe> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Follow 8 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-01-08 | joerg_wunsch | Status | In Progress | Fixed | |
Open/Closed | Open | Closed | |||
2007-01-08 | joerg_wunsch | Status | Confirmed | In Progress | |
2007-01-08 | joerg_wunsch | Item Group | None | libc code | |
2007-01-08 | joerg_wunsch | Severity | 3 - Normal | 4 - Important | |
Priority | 5 - Normal | 7 - High | |||
Status | None | Confirmed | |||
Assigned to | None | joerg_wunsch |
Powered by Savane 3.13-02a9.
Corresponding source code
This is an issue with the original BSD implementation our
implementation has been taken from. See here for the
FreeBSD fix:
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/random.c?f=h#rev1.21