C
Christian Christmann
Hi,
in one file I've a function that is used by another
file containing the main function:
file1.c:
....
void test( int a ) { ... }
....
main.c:
#include "file1.h"
int main( void )
{
int a = 0;
test(a);
return 0;
}
When I compile this file, I get a warning:
"warning: implicit declaration of function `test'.
In order to strictly meet all ANSIC-C 99 standards,
do I always need to forward function declarations
before they are used, like
void test( int );
before the main function or is this warning compiler-
specific and not enforced by the C99 standard?
Best regards,
Chris
in one file I've a function that is used by another
file containing the main function:
file1.c:
....
void test( int a ) { ... }
....
main.c:
#include "file1.h"
int main( void )
{
int a = 0;
test(a);
return 0;
}
When I compile this file, I get a warning:
"warning: implicit declaration of function `test'.
In order to strictly meet all ANSIC-C 99 standards,
do I always need to forward function declarations
before they are used, like
void test( int );
before the main function or is this warning compiler-
specific and not enforced by the C99 standard?
Best regards,
Chris