C declaration styles

Tom Neff tneff at atpal.UUCP
Fri Mar 25 07:14:29 AEST 1988


In article <18359 at sci.UUCP> phil at sci.UUCP (Phil Kaufman) writes:
>Declarations for functions are wonderful and avoid many errors but can 
>anyone tell me what the effect of the static modifier has in a function
>defrinition? I have often seen the following:
>       static int foofunction (int, int)


Microsoft C uses the /static/ storage class on a function definition to
indicate that the function has local scope to the containing source module,
i.e., no public symbol definition (PUBDEF record) will be emitted for that
function (or other symbol with module-wide scope).  Other compilation units
are free to define symbols with the same name (though I wouldn't normally
recommend it, as a matter of style), and MS LINK will not complain as long
as all of them (or all but one) define using /static/.

-- 

Tom Neff 



More information about the Comp.lang.c mailing list