FIX: 'char *' Passed to 'const char * &' Violates Type Safety (122540)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
This article was previously published under Q122540 SYMPTOMS
Visual C++ incorrectly allows a pointer to be passed to a function that
takes a non-const reference to a pointer to a const. This breaks C++ type
safety and allows the const data assigned to the reference to be modified
by the pointer after the function has returned.
RESOLUTION
To protect the const data, the reference should be a reference to a const
pointer to a const, that is: const char * const &.
STATUSThis bug was corrected in Microsoft Visual C++, version 6.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbfix kbVC600fix KB122540 |
---|
|