[mapguide-trac] #1686: "auto" keyword changes syntax meaning in VS2010

MapGuide Open Source trac_mapguide at osgeo.org
Wed May 11 02:01:43 EDT 2011


#1686: "auto" keyword changes syntax meaning in VS2010
----------------------------+-----------------------------------------------
   Reporter:  ChristineBao  |       Owner:       
       Type:  defect        |      Status:  new  
   Priority:  high          |   Milestone:       
  Component:  General       |     Version:  2.1.0
   Severity:  blocker       |    Keywords:       
External_id:                |  
----------------------------+-----------------------------------------------
 "auto" keyword changes syntax meaning in VS2010. http://msdn.microsoft.com
 /en-us/library/6k3ybftz.aspx


 {{{
 The auto keyword is a declaration specifier. However, the C++ standard
 defines an original and a revised meaning for this keyword. Before Visual
 C++ 2010, the auto keyword declares a variable in the automatic storage
 class; that is, a variable that has a local lifetime. Starting with Visual
 C++ 2010, the auto keyword declares a variable whose type is deduced from
 the initialization expression in its declaration.
 }}}

 This change caused project $OS\Oem\DWFTK7.1\develop\global\build\VC
 8.0\W3DToolkit\W3DToolkit.vcxproj build fails because there are numerous
 of "auto" keyword used in such way as:


 {{{
     auto        TK_Status       status = TK_Normal;
 }}}


 In the new syntax meaning of VS2010, it should used either without
 "auto"[[BR]]

 {{{
     TK_Status       status = TK_Normal;
 }}}
 [[BR]]
 or without the varable type.[[BR]]

 {{{
     auto        status = TK_Normal;
 }}}


 A compiler option "/Zc:auto-" is supposed to make VS2010 recognize "auto"
 in the old way, however it works for debug|win32 and release|win32, but
 fails for debug|x64 and release|x64. In x64 it always says: [[BR]]
 cl : Command line warning D9025: overriding '/Zc:auto-' with
 '/Zc:auto'[[BR]]
 And then build fail.[[BR]]
 A testing project is attached.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1686>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list