[comp.lang.c] Default storage classes outside functions

mouse@mcgill-vision.UUCP (der Mouse) (12/09/86)

In article <1063@ihdev.UUCP>, pdg@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@harvard.harvard.edu

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