PRB: Use of /ZI May Cause Access Violation (198477)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q198477 NOTE: Microsoft Visual C++ .NET (2002) and Visual C++ .NET (2003)
support both the managed code model that is provided by the .NET Framework and
the unmanaged native Windows code model. The information in this article
applies to unmanaged Visual C++ code only. SYMPTOMS Use of the compiler switch /ZI (Program Data Base for Edit
and Continue) may cause an access violation if you try to modify a text string.
RESOLUTION Use one of the following workarounds: - In the sample below, change "char * ptr" to "char
ptr[]".
- Do not use the /ZI switch.
STATUS As per C++ Standard (2.13.4.2) the effect of attempting to
modify a string literal is undefined.
Modification Type: | Major | Last Reviewed: | 12/2/2003 |
---|
Keywords: | kbCompiler kbprb KB198477 |
---|
|