This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3, 3.4] Minimal fixes for -fno-exceptions


Paolo Carlini wrote:

Something similar will be necessary for mainline too + a fix for
libsup++/guard.cc (which uses abort() without includind <cstdlib>)

Now guard.cc is Ok and I took care of mainline too.


Tested x86-linux.

Paolo.

////////////////
2004-12-29  Paolo Carlini  <pcarlini@suse.de>

	Minimal fixes for -fno-exceptions.
	* src/bitmap_allocator.cc (free_list::_M_get): Use
	__throw_exception_again, instead of plain throw.
	* testsuite/testsuite_abi.cc (get_symbol, examine_symbol,
	create_symbols): Likewise.
	* testsuite/testsuite_hooks.cc (verify_demangle,
	run_tests_wrapped_locale, run_tests_wrapped_env): Likewise.
	(try_named_locale): Wrap the whole catch in __EXCEPTIONS.
diff -urN libstdc++-v3-orig/src/bitmap_allocator.cc libstdc++-v3/src/bitmap_allocator.cc
--- libstdc++-v3-orig/src/bitmap_allocator.cc	2004-10-17 16:46:28.000000000 +0200
+++ libstdc++-v3/src/bitmap_allocator.cc	2004-12-30 00:33:57.000000000 +0100
@@ -96,7 +96,7 @@
 	    *__ret = __sz;
 	    return __ret + 1;
 	  }
-	throw std::bad_alloc();
+	__throw_exception_again std::bad_alloc();
       }
     else
       {
diff -urN libstdc++-v3-orig/testsuite/testsuite_abi.cc libstdc++-v3/testsuite/testsuite_abi.cc
--- libstdc++-v3-orig/testsuite/testsuite_abi.cc	2004-11-15 20:11:59.000000000 +0100
+++ libstdc++-v3/testsuite/testsuite_abi.cc	2004-12-30 00:39:54.000000000 +0100
@@ -263,7 +263,7 @@
     {
       ostringstream os;
       os << "get_symbol failed for symbol " << mangled;
-      throw symbol_error(os.str());
+      __throw_exception_again symbol_error(os.str());
     }
 }
 
@@ -277,7 +277,7 @@
       sym.print();
     }
   catch(...)
-    { throw; }
+    { __throw_exception_again; }
 }
 
 void 
@@ -420,7 +420,7 @@
     {
       ostringstream os;
       os << "create_symbols failed for file " << file;
-      throw runtime_error(os.str());
+      __throw_exception_again runtime_error(os.str());
     }
   return s;
 }
diff -urN libstdc++-v3-orig/testsuite/testsuite_hooks.cc libstdc++-v3/testsuite/testsuite_hooks.cc
--- libstdc++-v3-orig/testsuite/testsuite_hooks.cc	2004-05-13 18:29:39.000000000 +0200
+++ libstdc++-v3/testsuite/testsuite_hooks.cc	2004-12-30 00:39:54.000000000 +0100
@@ -137,7 +137,7 @@
 
     std::string w(wanted);
     if (w != s)
-      throw std::runtime_error(s);
+      __throw_exception_again std::runtime_error(std::string(s));
   }
 
   
@@ -184,7 +184,8 @@
 	VERIFY( preLC_ALL == postLC_ALL );
       }
     else
-      throw environment_variable(string("LC_ALL for ") + string(name));
+      __throw_exception_again
+	environment_variable(string("LC_ALL for ") + string(name));
   }
   
   void 
@@ -209,7 +210,8 @@
 	setenv(env, oldENV ? oldENV : "", 1);
       }
     else
-      throw environment_variable(string(env) + string(" to ") + string(name));
+      __throw_exception_again
+	environment_variable(string(env) + string(" to ") + string(name));
 #endif
   }
 
@@ -220,6 +222,7 @@
       {
 	return std::locale(name);
       }
+#ifdef __EXCEPTIONS
     catch (std::runtime_error& ex)
       {
 	// Thrown by generic and gnu implemenation if named locale fails.
@@ -228,6 +231,7 @@
 	else
 	  throw;
       }
+#endif
   }
 
   int

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]