DSPRelated.com
Forums

strange problem while not prototyping!!

Started by tArAng May 1, 2004

Hi All,
I just bumped across this strange thing by mistake. Dont know exactly why this is happening.

The thing is I am writing couple of functions in different file (other than where my main is) . I am including this file to my project folder and calling those functions. No where am I prototyping the functions, its just a definition.  Even in the main file I am not including the function file its just in the same project . Compiler or the linker doesnt throw any errors or anything. And still the functions are being called and executed properly. Its not a problem to me, I  m just curious as to how did it take care of not prototyping it and not declaring it as extern and stuff.

Just to make more sense out of my writing , kindly follow the pseudo-code.

abc.c

#include<stdio.h>
#include<stdlib.h>

main()
{
:
:
a();
b();
}

xyz.c

#include<stdio.h>
#include<stdlib.h>

void a(..,..,..,..)
{
:
:
:
}
void b(..,..,..,..)
{
:
:
:
}

I am including both the files abc.c and xyz.c in the project and building it .

Does CCS take care of it internally? or is it that since they are linked together its just like in same file so no need to put an extern directive in abc.c ( the file from which functions are called)  ( but it atleast needs  a prototype!! )

All inputs are welcome..

Best Regards,

Tarang Dadia
Graduate Student
Wireless Networking Lab
University of Texas at Arlington.