[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] avoid exit(1) when tcc_get_symbol() failes in libtcc.a
From: |
Joerg Raedler |
Subject: |
[Tinycc-devel] avoid exit(1) when tcc_get_symbol() failes in libtcc.a |
Date: |
Tue, 24 Jun 2003 15:09:21 +0200 |
User-agent: |
KMail/1.4.3 |
Dear Fabrice, dear tcc users,
I'm working on a Python (1) module which uses libtcc. The module let the user
call and control the tcc from Python. One goal (works at least partially now)
is to compile, link and call functions from the python interpreter at
runtime.
One problem appears when a symbol lookup failes with tcc_get_symbol(). The
function error() calls exit(1) after sending the error string to my own error
handler, which is not a good idea for a function contained in an external
library.
Now I use a workaround (with longjmp() in my error handler) to keep my program
running on lookup failures.
My idea is to get a NULL pointer as a result when tcc_get_symbol() failes.
This way my program can decide to exit or to keep running. Is this possible
or would this break a lot of other code?
Another solution would be to use error_set_jmp_enabled and error_jmp_buf, but
I can't access these variables by using libtcc.h only.
Thanks in advance,
Joerg Raedler
(1) www.python.org
--
dezentral energietechnik - Gebäudesimulation - Energiekonzepte
Adalbertstrasse 7-8 +++ 10999 Berlin
Tel/Fax: 030-611 07 45 2/8 +++ http://www.dezentral.de/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Tinycc-devel] avoid exit(1) when tcc_get_symbol() failes in libtcc.a,
Joerg Raedler <=