[uClibc] Exception in uClibc

Federico Munerotto mune at ieee.org
Tue Mar 9 21:42:14 UTC 2004


I tried this simple test program
==========================
#include <iostream>
#include <string>
#include <assert.h>
using namespace std;

int main()
{
   try {
     cout << "Hello world" << endl;

     int a = 0;
     int b = 10/a; // force divide by zero exception
     cout << "b=" << b << endl;
   }
   catch (...) {
     cout << "Something went wrong" << endl;
   }

   return 0;
}
==========================
compiled with
gcc  -l stdc++ -o hello hello.cpp
in the toolchain downloaded from uClibc's site in mid January and I get
as output

Hello world
Floating point exception

and not

Hello world
Something went wrong

as I was waiting for.

Do I have a wrong toolchain version, compile in a wrong way or whetever
else?

Can anybody give me a hint?

Thanks
-- 
Fede
-------------------------------------------------------------------------
        mune at ieee.org            Ing. Federico Munerotto
    home    http://www.krl.it/~mune
public key http://www.keyserver.net key ID C1ADA600
-------------------------------------------------------------------------
Lord of the Rings LITE(tm)
	-- by J.R.R. Tolkien
	Some guys take a long vacation to throw a ring into a volcano.




More information about the uClibc mailing list