The information in this article applies to:
SYMPTOMS
The include (.H) files shipped with Visual C++ do not use the #pragma
pack preprocessor directive around declarations of structures used by
C run-time functions. You may run into problems using C run-time
functions in your program if:
-or- CAUSEProblems occur because most C run-time functions expect the structures they work on to be built with the default compiler structure packing. The structure packing they expect would be specified with one of these compiler options: /Zp8, /Zp, or no /Zp. RESOLUTIONIf you are changing the default structure packing when building your application, add #pragma pack directives around the #includes of the C run-time include files to specify 8 as the packing alignment. This is illustrated in the sample code shown in the More Information section. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was fixed in Microsoft Visual C++, version 4.0. MORE INFORMATIONThere are other potential problems with changing the default structure packing. For additional information, please see the following article in the Microsoft Knowledge Base: Q117388 PRB: Structure Packing Causes Some Win32 Programs to Fail REFERENCES
Visual C++ Build Tools User's Guide, Chapter 2, Using the 32-Bit CL.
A description of the /Zp compiler option. Sample Code
Additional query words: 1.00 2.00 runtime run time error errors errno
Keywords : kbCRT kbVC |
Last Reviewed: July 28, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |