Index Home About Blog
From: "Dennis Ritchie" <>
Newsgroups: alt.folklore.computers,comp.lang.c
Subject: Re: A Dark Day...
Date: Wed, 28 May 2003 06:58:49 -0000
Message-ID: <bb1lbi$4plfd$>

"Michael Meissner" <> wrote in message
> Of course the original K&R also describes the global model as ref/def (ie,
> there can be only one definition, and 'extern' just created a reference), while
> the UNIX compiler implemented a relexed common model (you can have multiple
> defintions of globals without the 'extern', as long as there at most one
> initialization).

In designing the original version of the global model for C, the relaxed
model was adopted under the belief that it would be easily implementable
using any linker that supported Fortran named common blocks.

When it came to reality (i.e. linkers others than the ones we wrote)
this kind of crashed.  E.g. on GE/Honeywell systems there could
only be something like 63 named common regions.  The IBM
linkers probably could have done the job, but no one nearby
could figure out the appropriate magic for the compiler to
emit.  Thus the current rules.

> There was also the hack that the first character of the source had to be a '#'
> or the preprocessor wasn't run.  And the fact that the grammar in the back of
> K&R-I would not allow to declare the signal function (ie, a function that
> returns a pointer to a function).

This was mostly an efficiency hack, together with the fact that
the preprocessor was regarded with some suspicion in the early days.


Index Home About Blog