This is the mail archive of the cygwin mailing list for the Cygwin 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]

Using rand_r


Hey everyone,

I'm trying to use the function rand_r with gcc-4 in Cygwin 1.7, all my packages are up to date. It's supposed to be defined in stdlib.h, and I can see it there. But if I compile a program which uses it, I get:

warning: implicit declaration of function 'rand_r'.

The reason seems to be the check for #ifndef __STRICT_ANSI__ in stdlib.h. Even though I'm compiling with -std=c99, __STRICT_ANSI__ still gets declared, so the definition of rand_r is unavailable. This seems to be the same problem stated here:

http://sourceware.org/ml/newlib/2007/msg00783.html

Is this a bug or is rand_r supposed to be unavailable with C99?

Cheers,
Nicholas Sherlock


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


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