extern functions in header file

Ming-Chia Jiang jmc@wire.cs.nthu.edu.tw
Fri Sep 10 06:37:00 GMT 2004

Hi folks,

Is there any difference between declaring functions with prefix "extern" and 
without "extern" keyword in header files??
For example, I define a function FUNC(void, int) in test.c. And test.c 
includes the test.h with the following two conditions:

--test.h with extern--
extern void FUNC(void, int);

--test.h without extern--
void FUNC(void, int);

The output result seems no difference, and also the compiler does not show 
warning messages for both cases. Can anyone advise what the 'extern' keyword 
effects in the header file?

Best Regards

More information about the Gcc-help mailing list