Article View: comp.os.msdos.programmer
Article #5381BC++ Precompiled Header Bug
From: Antony Hodgson
Date: Fri, 22 Mar 1991 17:01
Date: Fri, 22 Mar 1991 17:01
29 lines
1355 bytes
1355 bytes
I just reported the following bug involving precompiled headers to Borland.
File: bar.h
class foo { public: foo() {} };
class bar { public: bar( foo = foo() ) {} };
File: main.cpp
#include <iostream.h>
#include "bar.h"
main()
{
bar b;
cout << "Done.\n";
}
If one builds this program with precompiled headers ON, then it runs fine.
If you then touch main.cpp and recompile, the .obj and .exe files have
a different size and the program crashes your system when you run it.
This happens in the IDE under any memory model and regardless of the
state of the DEBUG INFO IN OBJ option. Interestingly, if class foo
is eliminated and the bar constructor changed to bar( int = 1 ), all
is fine. Turning precompiled headers off solves the problem, but that
definitely defeats the purpose of precompilation.
Tony Hodgson
ahodgson@hstbme.mit.edu
Technical Details
Message-ID:
<1991Mar22.170134.11852@athena.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!ahodgsonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!ahodgson From: ahodgson@athena.mit.edu (Antony Hodgson) Newsgroups: comp.os.msdos.programmer Subject: BC++ Precompiled Header Bug Message-ID: <1991Mar22.170134.11852@athena.mit.edu> Date: 22 Mar 91 17:01:34 GMT Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 29