The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

/Wp64 (Detect 64-Bit Portability Issues)


The latest version of this topic can be found at -Wp64 (Detect 64-Bit Portability Issues).

This compiler option is obsolete. In versions of Visual Studio before Visual Studio 2013, this detects 64-bit portability problems on types that are also marked with the __w64 keyword.


By default, in versions of Visual Studio before Visual Studio 2013, the /Wp64 compiler option is off in the Visual C++ 32-bit compiler and on in the Visual C++ 64-bit compiler.

System_CAPS_ICON_important.jpg Important

The /Wp64 compiler option and __w64 keyword are deprecated in Visual Studio 2010 and Visual Studio 2012, and not supported starting in Visual Studio 2013. 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 or Visual Studio 2012, 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 D9002. Instead of using this option and keyword to detect 64-bit portability issues, use a Visual C++ compiler that targets a 64-bit platform and specify the /W4 option. For more information, see Configuring Programs for 64-Bit.

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 Configuring Programs for 64-Bit.

To set this compiler option in the Visual Studio development environment

  1. Open the project Property Pages dialog box.

    For more information, see How to: Open Project Property Pages.

  2. Click the C/C++ folder.

  3. Click the Command Line property page.

  4. Modify the Additional Options box to include /Wp64.

To set this compiler option programmatically

Compiler Options
Setting Compiler Options
Configuring Programs for 64-Bit