Re: question on using random in C on FC4 (perhaps slightly OT)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 16, 2005 at 09:00:33AM -0600, STYMA, ROBERT E (ROBERT) wrote:
> > So, ignoring this, I use the following in a random number 
> > generator program and
> > get the following while compilation....
> > 
> > gcc -c -O3 -std=c99 -Wall -pedantic random.c
> > random.c: In function 'setseed':
> > random.c:35: warning: implicit declaration of function 'srandom'
> > random.c: In function 'runi':
> > random.c:48: warning: implicit declaration of function 'random'
> > 
> > But I have included stdlib.h so what is the problem?
> >
> For whatever reason, the declare for srandom in 
> /usr/include/stdlib.h is surrounded by the #ifdef
> 
> #if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD 

Run
info libc 'Feature Test Macros'
and read all it says on this matter.

	Jakub


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux