In the process to port my current 32 bit application to 64 bit, I have added the compiler option /we4302 (Refer the SO Question Clarification: Porting 32 to 64 bit and the suggested answer by Hans Passant), I encountered a scenario where an ATLMFC Include file seems to have pointer truncation.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE\afxtempl.h
(163) : error C4302: 'type cast' : truncation from 'CControlBar *' to 'long'
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE\afxtempl.h
(163) : error C4302: 'type cast' : truncation from 'HMENU ' to 'long'
I was planning to add the compiler flag permanently to our build system, but if we have issues in MFC Includes, that would be a bad idea.
So My Question is
- Is the reported problem a false warning?
- If this indeed results a Pointer Truncation, what is the suggested solution
- Is it a bad idea to add the compiler option /we4302 in the build system?