C language book recommendations

rpjday at ccu.umanitoba.ca rpjday at ccu.umanitoba.ca
Tue May 21 22:58:40 AEST 1991


In article <36770001 at hpopd.pwd.hp.com> daves at hpopd.pwd.hp.com (Dave Straker) writes:
>>  C: A Reference Manual 3rd Edition
>>  Samuel P Harbison & Guy L Steele Jr
>>  Prentice Hall
>
>Seconded. This does seem to be a definitive work which is widely referenced.
>
Yup.  Even the occasional annoying typo doesn't detract much.
What typo?  Glad you asked.

Page 93, discussing the omitted storage class model which describes
how external names are linked:

"In this scheme, the storage class extern must be explicitly
included on all referencing declarations, and the storage class
must be omitted from the single defining declaration for each
external variable.  The defining declaration can include an
initializer, but it is not required to do so.  (It is illegal
to have both an initializer and the storage class extern in a 
declaration.)  This solution is probably the most common one,
and the one adopted in ANSI C."

  On the very next page, in a table showing the legalities of
various declarations in various models, we read that

extern int x = 0 ;

 in the omitted storage class model is treated as a reference.
However, according to the explanation on p. 93, this should
be illegal.  Comments?

R. Day



More information about the Comp.lang.c mailing list