You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2005/11/09 18:59:40 UTC

svn commit: r332092 - /incubator/stdcxx/trunk/etc/config/src/SIZE_T.cpp

Author: sebor
Date: Wed Nov  9 09:59:37 2005
New Revision: 332092

URL: http://svn.apache.org/viewcvs?rev=332092&view=rev
Log:
2005-11-09  Martin Sebor  <se...@roguewave.com>

	* SIZE_T.cpp: Initialized all local variables before copying them
	to function arguments to prevent MSVC 8.0 debugging assertions
	when the /RTC1 option (Run-Time Error Checks) is used.

Modified:
    incubator/stdcxx/trunk/etc/config/src/SIZE_T.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/SIZE_T.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/SIZE_T.cpp?rev=332092&r1=332091&r2=332092&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/SIZE_T.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/SIZE_T.cpp Wed Nov  9 09:59:37 2005
@@ -83,15 +83,17 @@
 const char* get_va_list_type_name (...) { return 0; }
 
 
-
-int main ()
+void get_type_names (int dummy, ...)
 {
-    clock_t   clk  = 0;   // arithmetic type
-    fpos_t    pos;        // object type
-    ptrdiff_t diff = 0;   // signed integral type
-    size_t    size = 0;   // unsigned integral type
-    time_t    tim  = 0;   // arithmetic type
-    va_list   va;         // object type
+    clock_t   clk  = 0;           // arithmetic type
+    fpos_t    pos  = fpos_t ();   // object type
+    ptrdiff_t diff = 0;           // signed integral type
+    size_t    size = 0;           // unsigned integral type
+    time_t    tim  = 0;           // arithmetic type
+    va_list   va;                 // object type
+
+    // initialize va to prevent an MSVC 8 debug assertion
+    va_start (va, dummy);
 
 #if !defined (_RWSTD_USE_CONFIG)
 
@@ -192,6 +194,12 @@
                 "/* may be an aggregate */\n");
         printf ("#define _RWSTD_FPOS_T_SIZE %u\n", sizeof pos);
     }
+}
+
+
+int main ()
+{
+    get_type_names (0);
 
     return 0;
 }