/Wp64 (Detect 64-Bit Portability Issues)
Detects 64-bit portability problems on types that are also marked with the __w64 keyword.
/Wp64
By default, the /Wp64 compiler option is off in the Visual C++ 32-bit compiler and on in the Visual C++ 64-bit compiler.
Important
|
|---|
|
The /Wp64 compiler option and __w64 keyword are deprecated in Visual Studio 2010. If you convert a project that uses this switch, the switch will not be migrated during conversion. To use this option in Visual Studio 2010, you must type the compiler switch under Additional Options in the Command Line section of the project properties. If you use the /Wp64 compiler option on the command line, the compiler issues Command-Line Warning D9035. Instead of using this option and keyword to detect 64-bit portability issues, use a Visual C++ compiler that targets a 64-bit platform. For more information, see 64-Bit Programming with Visual C++. |
Variables of the following types are tested on a 32-bit operating system as if they were being used on a 64-bit operating system:
-
int
-
long
-
pointer
If you regularly compile your application by using a 64-bit compiler, you can just disable /Wp64 in your 32-bit compilations because the 64-bit compiler will detect all issues. For more information about how to target a Windows 64-bit operating system, see 64-Bit Programming with Visual C++.
To set this compiler option in the Visual Studio development environment
-
Open the project Property Pages dialog box.
For more information, see How to: Open Project Property Pages.
-
Click the C/C++ folder.
-
Click the Command Line property page.
-
Modify the Additional Options box to include /Wp64.
To set this compiler option programmatically
- 3/14/2011
- ChristianTr
64-tests.cpp(15): warning C4311: 'type cast' : pointer truncation from 'int *' to 'int'
64-tests.cpp(15): warning C4312: 'type cast' : conversion from 'int' to 'int *' of greater size
Why doesn't the 64-bit compiler detect these issues w/o the flag? (which has been deprecated)
[tfl - 02 09 10] Hi - and thanks for your post.You should post questions like this to the MSDN Forums at http://forums.microsoft.com/msdn. You are much more likely get a quick response using the forums than through the Community Content.
For specific help about:
.Net Development : http://social.msdn.microsoft.com/Forums/en-US/category/visualstudio
Open Specifications : http://social.msdn.microsoft.com/Forums/en-US/category/openspecifications
SharePoint 2010 : http://social.msdn.microsoft.com/Forums/en-US/category/sharepoint2010
SQL : http://social.msdn.microsoft.com/Forums/en-US/category/sqlserver
Visual Studio : http://social.msdn.microsoft.com/Forums/en-US/category/visualstudio
- 8/19/2010
- scorpiotek
- 9/2/2010
- Thomas Lee
Important