Re: Books for advanced C++ debugging
On Jul 15, 11:02 pm, Joshua Maurice <joshuamaur...@gmail.com> wrote:
On Jul 15, 1:39 am, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
[...]
I would very much want
every compiler out there to use "fat" pointers and other techniques to
catch all undefined behavior, either at compile time or runtime. I
also very much want this to be entirely optional, and for it to be
expressly stated that no "good" C++ program should depend upon such
checks; they should exist only as "terminate the process" asserts
only.
The "option" is tricker than you seem to realize. Anything
which changes the size of an object (e.g. fat pointers vs.
normal pointers) breaks the ABI. You can't link object files
compiled with different options. (Or maybe you can link, but
the resulting program will just crash.)
Note that this is already the case with compilers which provide
"debugging" versions of std::vector and others. The debugging
changes the size and the behavior of std::vector, and mixing
code with and without debugging causes core dumps.
For most programs, we don't care about the speed.
Agreed, and with the current state of the C++ industry, C++ is
not the best language for every situation. Perhaps Java is be
more useful for most programs.
Only if you can accept a fairly low level of robustness.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34