Random problem (that is, problem with random())
Ralf Corsepius
ralf.corsepius at rtems.org
Tue Mar 29 02:22:40 UTC 2005
On Mon, 2005-03-28 at 15:12 -0500, Peter Dufault wrote:
> On Mar 28, 2005, at 9:00 AM, Sergei Organov wrote:
>
> >
> > Thus, random() is BSD beast, not ISO or POSIX.
> >
> > ISO C equivalent is called rand().
> >
>
> Good point. As is well known, "classic" rand() has its own problems,
> plus I still don't understand why the definition of random() isn't
> being published since it is in the header.
It's "#ifndef'ed __STRICT_ANSI__"
inside of the header but isn't implemented into libc.a.
IMO, this qualifies as a bug or at least as a weak coding in newlib.
> It must need a
> feature-enabling define before it shows up in the name space.
Yes - "Not using -ansi" (i.e. if you'd be using "gcc -ansi" "random()"
won't be available.)
Ralf
More information about the users
mailing list