This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: The sound of exceptions whooshing by....
OK, now I am really confused. I stripped it down to the absolute bare
essence:
#include <iostream>
int err = 42;
int main(int argc, char *argv[])
{
try
{
std::cerr << __PRETTY_FUNCTION__ << " Test build " << __DATE__ <<
" " << __TIME__ << " test throw of int" << std::endl;
throw err;
}
catch (const int &x)
{
std::cerr << __PRETTY_FUNCTION__ << " caught probe " << x <<
std::endl;
}
return 0;
}
If I test this with my native GCC, it works:
g++ -o test_probe main.cpp ; ./test_probe
int main(int, char**) Test build Jan 31 2012 09:50:09 test throw of int
int main(int, char**) caught probe 42
If I build this for the ARM it fails:
arm-linux-gnueabi-g++ -o testprobe.arm main.cpp; scp testprobe.arm
root@10.200.120.239:/tmp; ssh root@10.200.120.239 /tmp/testprobe.arm
testprobe.arm
int main(int, char**) Test build Jan 31 2012 09:51:48 test throw of int
terminate called after throwing an instance of 'int'
uname -a
Linux OMAP-35x 2.6.32.7-02428-g166a8f9-dirty #365 Mon Nov 28 10:48:51 CST
2011 armv7l GNU/Linux
I am now officially confused....