This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [basic-improvements] try/finally support for c/c++ - more tests
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Zack Weinberg <zack at codesourcery dot com>, Richard Henderson <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "jason at redhat dot com" <jason at redhat dot com>
- Date: 06 Nov 2002 23:33:23 -0800
- Subject: Re: [basic-improvements] try/finally support for c/c++ - more tests
- References: <20021107015959.GA17046@egil.codesourcery.com><8450000.1036650874@warlock.codesourcery.com>
>>>>> "Mark" == Mark Mitchell <mark@codesourcery.com> writes:
>> #define pthread_cleanup_push(routine_, arg_) \
>> __builtin_cleanup_block(routine_, arg_) {
>>
>> #define pthread_cleanup_pop(doit_) \
>> __builtin_toggle_do_cleanup(doit_); }
> Something like this is a much, much closer to what I think we should
> do.
You know, I ain't gonna comment much on this because I was just an
innocent bystander who just got told what to do, but...
It seems we sometimes, in an effort to be purists, bend over backwards
to avoid adding front end extensions and end up with rather ugly
interfaces. It's not like try/finally isn't available in other
compilers, and it's not like the __builtin_cleanup_block() stuff is
aesthetically pleasing either.
Just think, if any of the nifty features presently available as
extensions in GCC (inline, nested functions, labels as values, inline
assembly, etc) were to be brought up now, I'm 99% sure they'd be shot
down, purely because they were front end extensions. I think we're
loosing the GNU's Not Unix spirit.
Be that as it may, my point is purely a philosophical one. I will not
argue for either standpoint. Exception handling is not my thing.
> Thanks for working this through.
> --
> Mark Mitchell mark@codesourcery.com
> CodeSourcery, LLC http://www.codesourcery.com