--- title: "__w64 | Microsoft Docs" ms.custom: "" ms.date: "11/04/2016" ms.reviewer: "" ms.suite: "" ms.technology: - "cpp-language" ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords: - "__w64_cpp" - "__w64" dev_langs: - "C++" helpviewer_keywords: - "__w64 keyword [C++]" - "64-bit compiler [C++], __w64 keyword" - "Win64 [C++], __w64 keyword" ms.assetid: b9d0c820-e132-40bc-b532-56edca132a6c caps.latest.revision: 13 author: "mikeblome" ms.author: "mblome" manager: "ghogen" translation.priority.ht: - "cs-cz" - "de-de" - "es-es" - "fr-fr" - "it-it" - "ja-jp" - "ko-kr" - "pl-pl" - "pt-br" - "ru-ru" - "tr-tr" - "zh-cn" - "zh-tw" --- # __w64 (Microsoft Specific) This keyword is obsolete. In versions of Visual Studio earlier than Visual Studio 2013, this lets you mark variables, so that when you compile with [/Wp64](../build/reference/wp64-detect-64-bit-portability-issues.md) the compiler will report any warnings that would be reported if you were compiling with a 64-bit compiler. ## Syntax ``` type __w64 identifier ``` #### Parameters `type` One of the three types that could cause problems in code being ported from a 32-bit to a 64-bit compiler: `int`, `long`, or a pointer. `identifier` The identifier for the variable you are creating. ## Remarks > [!IMPORTANT] > The [/Wp64](../build/reference/wp64-detect-64-bit-portability-issues.md) compiler option and `__w64` keyword are deprecated in Visual Studio 2010 and Visual Studio 2013 and removed starting in Visual Studio 2013. If you use the `/Wp64` compiler option on the command line, the compiler issues [Command-Line Warning D9002](http://msdn.microsoft.com/en-us/c58b405b-0f26-434e-b57f-4f05e1ca81e6). The `__w64` keyword is silently ignored. 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 [Configuring Programs for 64-Bit](../build/configuring-programs-for-64-bit-visual-cpp.md). Any typedef that has `__w64` on it must be 32 bits on x86 and 64 bits on x64. To detect portability issues by using versions of the Visual C++ compiler earlier than Visual Studio 2010, the `__w64` keyword should be specified on any typedefs that change size between 32 bit and 64 bit platforms. For any such type, `__w64` must appear only on the 32-bit definition of the typedef. The `__w64` keyword is ignored if the compilation does not use `/Wp64`. For more information about porting to 64-bit, see the following topics: - [Compiler Options](../build/reference/compiler-options.md) - [Porting 32-Bit Code to 64-Bit Code](../build/common-visual-cpp-64-bit-migration-issues.md) - [Configuring Programs for 64-Bit](../build/configuring-programs-for-64-bit-visual-cpp.md) ## Example ``` // __w64.cpp // compile with: /W3 /Wp64 typedef int Int_32; #ifdef _WIN64 typedef __int64 Int_Native; #else typedef int __w64 Int_Native; #endif int main() { Int_32 i0 = 5; Int_Native i1 = 10; i0 = i1; // C4244 64-bit int assigned to 32-bit int // char __w64 c; error, cannot use __w64 on char } ``` ## See Also [Keywords](../cpp/keywords-cpp.md)