Annotation of coherent/a/usr/man/ALL/extern, revision 1.1.1.1

1.1       root        1: 
                      2: 
                      3: extern                      C Keyword                      extern
                      4: 
                      5: 
                      6: 
                      7: 
                      8: Declare storage class
                      9: 
                     10: 
                     11: extern indicates that a C element belongs to the _e_x_t_e_r_n_a_l storage
                     12: class.  Both  variables and functions  may be declared  to be ex-
                     13: tern.  Use of this keyword tells the C compiler that the variable
                     14: or  function is  defined outside  of the  present file  of source
                     15: code.  All  functions and variables defined  outside of functions
                     16: are implicitly extern unless declared static.
                     17: 
                     18: When a  source file references  data that are  defined in another
                     19: file, it must  declare the data to be extern,  or the linker will
                     20: return an error message of the form:
                     21: 
                     22: 
                     23:         undefined symbol _n_a_m_e
                     24: 
                     25: 
                     26: For example, the following declares the array tzname:
                     27: 
                     28: 
                     29:         extern char tzname[2][32];
                     30: 
                     31: 
                     32: When  a function  calls  a function  that is  defined in  another
                     33: source file or in a library, it should declare the function to be
                     34: extern.  In  the absence of  a declaration, extern  functions are
                     35: assumed to  return ints, which may cause  serious problems if the
                     36: function actually returns a  32-bit pointer (such as on the 68000
                     37: or i8086 LARGE model), a long, or a double.
                     38: 
                     39: For example, the function mmaalllloocc appears in a library and returns
                     40: a pointer; therefore, it should be declared as follows:
                     41: 
                     42: 
                     43:         extern char *malloc();
                     44: 
                     45: 
                     46: If you do not do so,  the compiler assumes that mmaalllloocc returns an
                     47: iinntt, and generate the error message
                     48: 
                     49: 
                     50:         integer pointer pun
                     51: 
                     52: 
                     53: when you attempt to use mmaalllloocc in your program.
                     54: 
                     55: ***** See Also *****
                     56: 
                     57: auto, C keywords, pun, register, static, storage class
                     58: 
                     59: 
                     60: 
                     61: 
                     62: 
                     63: 
                     64: COHERENT Lexicon                                           Page 1
                     65: 
                     66: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.