Path: 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 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 #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