eexxtteerrnn -- C Keyword

Declare storage class

eexxtteerrnn indicates  that a C  element belongs to the  _e_x_t_e_r_n_a_l storage class.
Both variables  and functions  may be  declared to be  eexxtteerrnn. Use  of this
keyword  tells the  C compiler  that  the variable  or function  is defined
outside of  the present file  of source code.  All  functions and variables
defined outside of functions are implicitly eexxtteerrnn unless declared ssttaattiicc.

When a  source file references  data that are  defined in another  file, it
must declare  the data  to be  eexxtteerrnn, or the  linker will return  an error
message of the form:

    undefined symbol _n_a_m_e

For example, the following declares the array ttzznnaammee:

    extern char tzname[2][32];

When a function calls a function  that is defined in another source file or
in a library,  it should declare the function to  be eexxtteerrnn. In the absence
of a  declaration, eexxtteerrnn functions  are assumed to return  iinntts, which may
cause serious  problems if the  function actually returns  a 32-bit pointer
(such as on the 68000 or i8086 LARGE model), a lloonngg, or a ddoouubbllee.

For  example,  the function  mmaalllloocc  appears  in a  library  and returns  a
pointer; therefore, it should be declared as follows:

    extern char *malloc();

If you do  not do so, the compiler assumes  that mmaalllloocc returns an iinntt, and
generate the error message

    integer pointer pun

when you attempt to use mmaalllloocc in your program.

_S_e_e _A_l_s_o
aauuttoo, CC kkeeyywwoorrddss, ppuunn, rreeggiisstteerr, ssttaattiicc, ssttoorraaggee ccllaassss
ANSI Standard, section 6.5.1
