xor@aix01.aix.rpi.edu (Joseph Schwartz) (04/24/91)
In article <1991Apr23.212105.28138@hubcap.clemson.edu> mjs@hubcap.clemson.edu (M. J. Saltzman) writes: >In article <72969@brunix.UUCP> gvr@cs.brown.edu (George V. Reilly) writes: >>In article <680@taumet.com> steve@taumet.com (Stephen Clamage) writes: >>+ The ANSI C standard says explicitly that a union may contain a bitfield. >> >>Well, that's another thing that Harbison & Steele III have got wrong, >>then. On p. 128, it says: >> The syntax for defining components [in unions] is the same >> as that used for structures, except that bit fields are >> not permitted in unions. > >Sorry to bother you all, but does anyone have a list of errata for >H&S? Is it really that bad? Are there any other good references >(short of the standard itself) for day-to-day use? > >E-mail is fine, I don't want to take up more bandwidth than I already >have. > >Thanks very much. > > Matthew Saltzman > mjs@clemson.edu I recently found an error in K&R2 (the "Draft-Proposed ANSI" printing). On page 164, it says that fputs "returns EOF if an error occurs, and zero otherwise." It SHOULD say, "...and a non-negative value otherwise." They got it right on page 247, though. I'm sure I'm not the first to notice this error, and I assume it's been corrected in later printings. If an errata list exists, shouldn't it be included in the FAQ list? -- Joe Schwartz Internet: xor@mts.rpi.edu Bitnet: userez3n@rpitsmts
bhoughto@pima.intel.com (Blair P. Houghton) (04/26/91)
In article <ndtg!6d@rpi.edu> xor@aix01.aix.rpi.edu (Joseph Schwartz) writes: [...there's bugs in KnRII, too...] Periodicity: one semester. Okay, before everyone goes posting their faves, here's a list of errata that Dennis Ritchie posted two years ago. They should actually have been included in later printings of the book, by now. I don't have a list for H&S. I don't even have my own copy of H&S. I do have my own copy of the Standard, so I don't really want a copy of H&S. Not unexpectedly, the Standard, by definition, is error-free :-). Please check this list before posting. --Blair "Wishful thinking." >From davea%quasar.wpd.sgi.com@SGI.COM Fri Oct 5 13:43:18 1990 Date: Fri, 5 Oct 90 13:40:42 PDT >From: davea%quasar.wpd.sgi.com@SGI.COM Subject: dmr's posting attached To: bhoughto@cmdnfs.intel.com, poser@csli.Stanford.EDU Message-Id: <9010052040.AA09702@quasar.wpd.sgi.com> Status: R You asked: here it is. Regards, [ David B. Anderson Silicon Graphics (415)335-1548 davea@sgi.com ] [``What can go wrong?'' --Calvin and Hobbes] --------------------cut here----------------------------- >Article 19774 of comp.lang.c: >From: dmr@alice.UUCP Newsgroups: comp.lang.c Subject: Re: Updates to K&R 2 Message-ID: <9436@alice.UUCP> Date: 5 Jun 89 07:48:55 GMT Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 98 I was a bit surprised to see Chris Beierl's posting of the errata for K&R second edition. More accurately, I was surprised to hear that it was present in his copy of the book, since it was prepared for posting to this group. We thought we gave it to our editor at Prentice-Hall for his information; he didn't tell us that it was to be included as an errata list, or even let us know that this was possible. We would have worded it a bit differently. In any event, here is what we have now. All of these changes should be in the second printing. The main difference between this and what Beierl posted is the addition of the statement about initialization of automatic arrays on p. 86. [Incidentally, the range of tm_sec is really 0 through 61. It seems that two consecutive leap seconds are permitted.] Dennis Ritchie dmr@research.att.com att!research!dmr --------- Now that X3J11 has voted to send its draft to X3, and further substantive changes in the draft standard are unlikely, Brian and I are preparing fixes to put in any future printings of the second edition of "The C Programming Language." Fortunately, they are minor. 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: changes 71, 76, 82, 121. On page 86, error corrected: missing automatic array initializers are zero too. On page 168: changed 1 to 1.0 in frand() to avoid potential overflow. Minor typos are corrected on pages 87, 89, 164, 165, 180. The inconspicuous references to 'noalias' on pages 192 and 212 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 draft of a year ago 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. CLK_TCK was changed late (12/15/88) to CLOCKS_PER_SEC. p 257: drop U and L suffixes from <limits.h> constants. tm_sec range (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.
beierl_c@apollo.HP.COM (Christopher Beierl) (04/29/91)
In article <ndtg!6d@rpi.edu> xor@aix01.aix.rpi.edu (Joseph Schwartz) writes: >... >I recently found an error in K&R2 (the "Draft-Proposed ANSI" printing). >On page 164, it says that fputs "returns EOF if an error occurs, and >zero otherwise." It SHOULD say, "...and a non-negative value otherwise." >They got it right on page 247, though. > >I'm sure I'm not the first to notice this error, and I assume it's been >corrected in later printings. If an errata list exists, shouldn't it >be included in the FAQ list? Included below is an errata list for the FIRST printing of K&R2 (the "Draft-Proposed ANSI" printing). These should have been corrected in subsequent printings. The error indicated above is not on this list, and has not been corrected as of the fifth printing (the most recent I have). -Chris (NOTE: This came from dmr@research.att.com in June '89) Now that X3J11 has voted to send its draft to X3, and further substantive changes in the draft standard are unlikely, Brian and I are preparing fixes to put in any future printings of the second edition of "The C Programming Language." Fortunately, they are minor. 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: changes 71, 76, 82, 121. On page 86, error corrected: missing automatic array initializers are zero too. On page 168: changed 1 to 1.0 in frand() to avoid potential overflow. Minor typos are corrected on pages 87, 89, 164, 165, 180. The inconspicuous references to 'noalias' on pages 192 and 212 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 draft of a year ago 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. CLK_TCK was changed late (12/15/88) to CLOCKS_PER_SEC. p 257: drop U and L suffixes from <limits.h> constants. tm_sec range (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. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Christopher T. Beierl Internet: beierl_c@apollo.HP.COM;beierl_c@apollo.com Apollo Computer, Inc. UUCP: {mit-eddie,yale,uw-beaver}!apollo!beierl_c A Subsidiary of Hewlett-Packard Phone: (508) 256-6600