Tiny Core Linux
Tiny Core Extensions => TCE Bugs => Topic started by: robc on July 15, 2009, 08:06:13 PM
-
Has anyone been able to get the exception handling to work?
Here is a simple test I wrote:// testing.cpp
#include <iostream>
using namespace std;
int main() {
int i;
{
try {
printf("Input: ");
cin >> i;
throw i;
printf("No exception caught.\n");
} catch (...) {
printf("Caught exception.\n");
}
}
}
The exception is not handled, instead it goes straight to terminate.
This was compiled with: g++ -x c++ -fexceptions -o testing testing.cpp
-
Apparently so, It works fine in TC 1.4.3.
-
is this because the CXXFLAGS are set to this in the TC 2.X gcc?
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions"
-
According to my notes, this was how gcc was compiled...
-
Is it possible that this would be the reason why that happens http://forum.tinycorelinux.net/index.php?topic=1262.0 ; according with my investigations: http://lists.busybox.net/pipermail/uclibc/2006-June/036553.html .
Any elegant solution?
Congrats for this great distro to all of you.
-
I'm connecting the dots here ...
http://forum.tinycorelinux.net/index.php?topic=1784.0
I am confused. Does this mean that anything we compile in 2.x cannot use exceptions? Is it true that this behavior cannot be avoided with the "-fexceptions" option?
-
Thanks, Juanito for the new binaries of gcc 4.4.0 .
Now it is possible to compile and run things that fail before in TC2.x (but not in TC1.4.3), as indicated in above posts (v.g. amsn).
The only issue is that as TinyCore 2.x is not build with this release, it is necessary to install as dependence. Until the definitive solution, this is a good approach.
Thanks again.
-
Could someone provide a summary of what is needed in order to build and run programs that rely on exceptions?
- Extensions that must be installed when building.
- Extensions that must NOT be installed when building
- Extensions that must be installed when running the program
- Extensions that must NOT be installed when running the program
If the program depdends (dynamically links) to libraries in other extensions, do these extensions also have to be built with exceptions enabled?
Kind Regards
/Lars
-
This was compiled with: g++ -x c++ -fexceptions -o testing testing.cpp
When I try, I get this: $ g++ -x c++ -fexceptions -o testing testing.cpp
testing.cpp: In function 'int main()':
testing.cpp:9: error: 'printf' was not declared in this scope
testing.cpp:14: error: 'printf' was not declared in this scope
..but this works: // testing.cpp
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int i;
{
try {
printf("Input: ");
cin >> i;
throw i;
printf("No exception caught.\n");
} catch (...) {
printf("Caught exception.\n");
}
}
}