Article ID: 216720 - Last Review: November 18, 2003 - Revision: 2.0 FIX: Bitwise OR for Bool& Types Causes Error When OptimizedThis article was previously published under Q216720 On This PageSYMPTOMS
When using a bitwise OR operation on a bool reference and compiling with optimizations that include /Og (global optimizations), the resulting executable may generate an access violation.
CAUSE
The current implementation of a bool is an 8-bit value. The OR operation with /Og on a bool reference operates on a 32-bit value.
RESOLUTION
Do not use bitwise operators with bool references. Use bool values instead.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base: MORE INFORMATIONSteps to Reproduce BehaviorCompile with /Og | Article Translations
|
Back to the top
