Language implementation bugs shown in "Thinking in C++"

Bruce Eckel Bruce@EckelObjects.com
Tue Jun 1 09:55:00 GMT 1999


The current version of the code in the online book "Thinking in C++ (2nd
Edition) has produced numerous instances of what I believe are errors in the
C++ implementation of the egcs compiler released May 24. The list of files
that does not compile (but that I think should compile) are shown below.
Note that each file is preceded by its chapter number (which is also its
subdirectory name). Also, for some groups of programs I've given an
indication of where I think the problem lies (many of these seem to be
template problems, but sometimes it's as simple as the missing 'at()' member
function in an STL container).

The source code can be located at:
ftp://www.mindview.net/pub/eckel/TIC2e/
To unpack the code under Linux/Unix, you should use the zip/unzip tools
found at:
http://www.cdrom.com/pub/infozip/
And say 'unzip -a sourcecode.zip' which will correct for Unix/DOS newlines

Please note that if you use the normal "make" (e.g. 'make egcs') you will
get a clean build, since the makefiles are generated so as to exclude the
files that will not compile. It's probably easiest to compile the files that
show compiler errors one at a time, but you can also say:
make -f makefile.bugs egcs
to go through all the files that generate bugs.

Again, I believe that my use of the language is correct, and in almost all
cases I've gotten the code to compile with one other compiler (generally
Borland C++ Builder 4). If you can point out cases where I've made mistakes,
however, I would greatly appreciate it, and it will benefit the book, which
will remain freely downloadable even after it is published.

Thanks for your time.
Bruce@EckelObjects.com

------- Names of code listings that won't compile:
# Error in streambuf.h:
C18:Cppcheck.cpp
# Not sure:
C19:applyGromit2.cpp
# Missing the standard library 'at()':
C19:Sorted.cpp
C19:ExplicitInstantiation.cpp
# A basic compiler bug
C20:BankTeller.cpp
C20:AssocInserter.cpp
# Problem with the egcs iterator header
C20:StreambufIterator.cpp
C20:RawStorageIterator.cpp
# egcs is missing istreambuf_iterator
C20:WordList2.cpp
C20:TokenizeTest.cpp
C20:TokenIteratorTest.cpp
C20:WordCount.cpp
C20:MultiSetWordCount.cpp
# egcs is missing std::iterator:
C20:Ring.cpp
# egcs is missing char_traits
C17:ICompare.cpp
# egcs vector and deque (at least) are missing
# the "at()" functions:
C20:IndexingVsAt.cpp
# There’s a problem with the egcs string class:
C17:Compare2.cpp
# Problem with egcs priority_queue:
C20:PriorityQueue4.cpp
C20:PriorityQueue8.cpp
# Broken in this compiler’s library:
C20:BitSet.cpp
# These are because <sstream> isn’t implemented
C18:NumberPhotos.cpp
C20:StringVector.cpp
C20:FEditTest.cpp
C20:StringDeque.cpp
C20:VectorOfBool.cpp
C20:WildLifeMonitor.cpp
C21:SortTest.cpp
C21:SortedSearchTest.cpp
C21:Binder4.cpp
C21:ForEach.cpp
# Problem in parsing PrintSequence.h:
C21:Counting.cpp
C21:Manipulations.cpp
C21:SearchReplace.cpp
C21:Comparison.cpp
C21:Removing.cpp
C21:CalcInventory.cpp
C21:TransformNames.cpp
C21:SpecialList.cpp
C21:NumericTest.cpp

=============================
Bruce Eckel    http://www.BruceEckel.com
Contains free electronic books: "Thinking in Java" & "Thinking in C++ 2e"




More information about the Gcc-bugs mailing list