Hello, Alexandre!
> > #ifdef __cplusplus
> > #undef exit
> > #define exit(x) return (x)
> > #endif
>
> But what if a hand-coded test calls exit() from some function other
> than main()?
Nothing good, obviously :-(
Ignore my patch, we should make a better one.
We probably should create a table of what declarations work with what
compilers.
No declaration stdlib.h Simple Using throw
egcs-1.1.2 Ok Ok Ok Ok
gcc-2.95.2 Ok Ok Ok Ok
gcc-2.97 Ok Ok Not Ok Ok
Can anybody continue? How about commercial compilers?
If there is a declaration that always works we should stick with it.
Otherwise we should check what declaration if preferred for the given
compiler and use it.
Regards,
Pavel Roskin
- Problem with exit() and new version of gcc. Mo DeJong
- Re: Problem with exit() and new version of gcc. Mo DeJong
- Re: Problem with exit() and new version of gcc. Assar Westerlund
- Re: Problem with exit() and new version of gcc. Pavel Roskin
- Re: Problem with exit() and new version of gcc. Alexandre Oliva
- Re: Problem with exit() and new version of gcc... Raja R Harinath
- Re: Problem with exit() and new version of gcc. Pavel Roskin
- Re: Problem with exit() and new version of gcc... Alexandre Oliva
- RE: Problem with exit() and new version of gcc. Bernard Dautrevaux
