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

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

 



Globe Trotter wrote:

> 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?

Can we see the first 50 lines of your code?

      1 #include <stdlib.h>
      2 #include <stdio.h>
      3
      4 int main() {
      5         printf("%ld\n", random());
      6         return 0;
      7 }

gcc -c -O3 -Wall -pedantic test.c

works fine here with no errors or warnings.

$ gcc --version
gcc (GCC) 4.0.1 20050727 (Red Hat 4.0.1-5)

Is your $INCLUDE set in your shell and you pick up a different stdlib.h?

-Andy

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


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

  Powered by Linux