I am trying to compile a C program on a Linux system. I have an #include
statement for stdlib.h
.
When I compile the program with gcc
as follows:
gcc -std=c99 -g -o progfoo progfoo.c progbar.c
I get warnings about Implicit declaration of function [srand48, drand48, bzero, or close]
.
Compiling instead as:
gcc -g -o progfoo progfoo.c progbar.c
doesn't give me the warnings, but it does yell about my use of for
loops (which was the rationale for adding -std=c99
in the first place).
Given that man srand48
mentions including <stdlib.h>
, which I have, I'm unsure what else the problem could be. The for
loops aren't essential to anything (they were just to save time in initializing an array) so I have no problem removing them, but before I do I'd like to confirm whether the c99
standard is superseding some aspect of my #include
statements.
I'm using gcc 4.1.2-50 (Red Hat)
.