Scholarly Resources for CompSci Undergrads

C Programming Language

Errata list for K&R II (July 1992)

From danpop@mail.cern.ch Wed Mar 27 09:45:29 EST 1996
Path: newshost.uwo.ca!torn!howland.reston.ans.net!newsfeed.internetmci.com!swrinde!sgigate.sgi.com!wrdis02.robins.af.mil!rcp6.elan.af.mil!rscernix!danpop
From: danpop@mail.cern.ch (Dan Pop)
Newsgroups: comp.lang.c
Subject: Re: H&S4 errata?
Date: 26 Mar 96 18:10:56 GMT
Organization: CERN European Lab for Particle Physics
Lines: 147
Message-ID: <danpop.827863856@rscernix>
References: <mjs.827166006@hubcap> <4is2p9INNgag@keats.ugrad.cs.ubc.ca> <3152CFAB.32FF@oc.com> <4j4lh0INNgf9@anvil.ugrad.cs.ubc.ca> <garyg-2503962216030001@ts1-005.jaxnet.com>

In <garyg-2503962216030001@ts1-005.jaxnet.com> garyg@jax.jaxnet.com (Gary M. Greenberg) writes:

>It is a solid piece of work, and I wish I had noted the site I was at
>the had both the K&R 2 and an H&S errata. If I cross it's path again,
>I'll get back to y'all.

Here's the most recent of version of the K&R2 errata (that I know of):
(note the last section: "Not yet fixed in any printing")

From: dmr@research.att.com
Date: Thu, 8 Dec 94 01:44 EST
Subject: the errata list

Here is what we've accumulated.  The file hasn't changed
since July 1992.
Page numbers could be off by a tiny amount.

        Dennis
-----
     Changes to The C Programming Language, 2nd Edition

     As the C standard wended its way through the approval
process and become final, Brian and I prepared fixes to put
in new printings of the second edition of  ``The C
Programming Language.'' These printings are identified by a
large red ``ANSI C'' on the upper right front corner.
Fortunately, the changes are minor; some repair our bugs, a
few account for last-minute changes in the draft standard.
For the benefit of previous and near-future purchasers, here
are the changes that were made:

Two or three sentences in the Preface and Introduction are
updated to describe the state of the Standard.

atof is in  <stdlib.h>, not  <math.h>; this changes 71, 76,
82, 121.

On page 86, error corrected:  missing automatic initializers
are zero too.

On page 168: changed 1 to 1.0 to avoid potential overflow.

Minor typos are corrected on pages 87, 89, 164, 165, 168,
180.

The inconspicuous references to  noalias on pages 192 and
211 are removed.

The following paragraph is added to the end of section A6.6
(p 199):

     A pointer may be converted to another pointer whose
     type is the same except for the addition or removal of
     qualifiers (A4.4, A8.2) of the object type to which the
     pointer refers.  If qualifiers are added, the new
     pointer is equivalent to the old except for
     restrictions implied by the new qualifiers.  If
     qualifiers are removed, operations on the underlying
     object remain subject to the qualifiers in its actual
     declaration.


On p. 199, beginning of section A6.8, ``Any pointer may be
converted to type  void  *...'' is changed to ``Any pointer
>to an object< may be converted to type  void  *...''.

On p. 204, A7.4.4, ``The operand of the unary + operator
must have arithmetic or pointer type...'' should read ``must
have arithmetic type...''.

On p. 206, A7.9, about relational operators:  ``Pointers to
objects of the same type may be compared...'' is changed to
``Pointers to object of the same type >(ignoring any
qualifiers)< may be compared...''.

The indented material on p. 209, ``According to the
restrictions...  relaxing it.'' is removed.   [This is
related to the paragraph added above.  The wording of the
penultimate draft made it useless to take an (int *)
pointer, cast it to (const  int  *), then cast it back to
(int *).]

On p. 219 middle, initialization of structures, add
``Unnamed bit-field members are ignored, and are not
initialized.''


Appendix B changes:

p 242:  Add ``fflush(NULL) flushes all output streams.'' to
 fflush description.

p 243:  Change to ``it must be called before reading,
writing >or any other operation<'' in  setvbuf description.

p 249:  Add ``Comparison functions treat arguments as
unsigned  char arrays.''  to  <string.h> description.

p 255:  Change range of  tm_sec to (0,61) for leap seconds.

p 255:  Change  CLK_TCK to  CLOCKS_PER_SEC.

p 257:  Drop  U and  L suffixes from  <limits.h> constants.
 tm_sec range is (00,61) here too.

Appendix C change:

p 261:  Change ``External declarations without any
specifiers...'' to ``External >data< declarations without
any specifiers...''.

The index has been reprinted to fix a couple of typos and
account for motion within Appendix A;  one page of the table
of contents is changed.


October, 1989: Minor changes on page 131 to add & to last
example, on page 208 to change ``equal'' to ``unequal'' in
the description of logical OR, and on page 254 to clarify
that only volatile automatics are saved with longjmp.

Not yet fixed in any printing:

page 53: Note under the table should say & as well as  + - *
has higher precedence as a unary operator.

page 111: indent is too large, and a bit of program text is
cut off.

page 231  extra right paren in nested call to cat macro.

page 246: first argument of sscanf should have type
const char *.

page 249: in description of strncpy, t => ct.

There is no mention of the offsetof macro, and should be.

The scanf functions do not ignore white space in formats.

p. 49 shifts:  `which must be positive' -> `which must be non-negative'

--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland