stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r332092 - /incubator/stdcxx/trunk/etc/config/src/SIZE_T.cpp
Date Wed, 09 Nov 2005 17:59:40 GMT
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  <sebor@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;
 }



Mime
View raw message