Default storage classes outside functions

der Mouse mouse at mcgill-vision.UUCP
Tue Dec 9 19:46:53 AEST 1986


In article <1063 at ihdev.UUCP>, pdg at ihdev.UUCP (P. D. Guthrie) writes:
> Something interesting that is in the text though is the way that the
> default sc-specifiers are assigned.  K&R state that the default is
> auto inside a function and *extern* outside.  It seems to be *static*
> in most C implementations these days.

I have to differ.  The following produce *three* different effects:

int x;
extern int x;
static int x;

(outside a function).  So the default is really neither - or both; it
has the visibility of extern with the memory allocation of static.

One thing VMS C did right, or at least better: globaldef and globalref,
presumably doing the obvious things.

					der Mouse

USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!mcgill-vision!mouse
     think!mosart!mcgill-vision!mouse
Europe: mcvax!decvax!utcsri!mcgill-vision!mouse
ARPAnet: think!mosart!mcgill-vision!mouse at harvard.harvard.edu

[USA NSA food: terrorist, cryptography, DES, drugs, CIA, secret, decode]



More information about the Comp.lang.c mailing list