Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compilers supporting exception handling

8 views
Skip to first unread message

humptydumpty

unread,
Feb 23, 2008, 12:41:48 AM2/23/08
to
Hi
I want to know which compilers support the exception handling keywords

try , catch and throw

Thanks in advance
Jamie

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

peter koch larsen

unread,
Feb 23, 2008, 11:24:01 AM2/23/08
to
On 23 Feb., 06:41, humptydumpty <jagatsi...@gmail.com> wrote:
> Hi
> I want to know which compilers support the exception handling keywords
>
> try , catch and throw
>
They all do - provided they are C++ compilers. You would have to find
an extremely old compiler or a special compiler for Embedded C++ if it
would not support exceptions.

/Peter

Bart van Ingen Schenau

unread,
Feb 23, 2008, 11:45:32 AM2/23/08
to
humptydumpty wrote:

> Hi
> I want to know which compilers support the exception handling keywords
>
> try , catch and throw
>
> Thanks in advance
> Jamie
>

It might be best to turn your question around;
Which C++ compilers do NOT support exception handling.

If you have a fairly recent compiler (less than 10 years old) for a
general-purpose target, I expect that all those compilers support
exception handling.

The only compilers where exception handling is absent are
- compilers that predate the addition of it to the C++ language, which
happened prior to 1998 (the release date of the first C++ standard), or
- compilers that target severely resource-constrained embedded
platforms. If you have one of those, you *will* know about its
limitations.

Bart v Ingen Schenau
--
a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq
c.l.c FAQ: http://c-faq.com/
c.l.c++ FAQ: http://www.parashift.com/c++-faq-lite/

Lance Diduck

unread,
Feb 24, 2008, 4:40:51 AM2/24/08
to
On Feb 23, 12:41 am, humptydumpty <jagatsi...@gmail.com> wrote:
> Hi
> I want to know which compilers support the exception handling keywords
>
> try , catch and throw
>
> Thanks in advance
> Jamie
This sounds like one of those situations where a developer wants to
use those newfangled C++ exceptions and his manager (or "senoir team
lead") has to be convinced.
After all, his manager has never come up to speed (after 15 years) and
has heard all kinds of bad things about them.
Sadly, this is not uncommon.

C++ exceptions are standard and implemented in virutally every
compiler. It is hard to find one that doesnt implement them ( I cant
think of any, but perhaps the C++ for PIC microcontrollers do not) but
unfortunatley, it is not hard to find a "senior" developer who thinks
they are spawn of the devil

Lance

Bob

unread,
Feb 24, 2008, 4:40:58 AM2/24/08
to
Bart van Ingen Schenau wrote:
>
> If you have a fairly recent compiler (less than 10 years old) for a
> general-purpose target, I expect that all those compilers support
> exception handling.
>
> The only compilers where exception handling is absent are
> - compilers that predate the addition of it to the C++ language, which
> happened prior to 1998 (the release date of the first C++ standard),
> or - compilers that target severely resource-constrained embedded
> platforms. If you have one of those, you will know about its
> limitations.
>

Exceptions were discussed in the ARM, but there was a bit of a lag of
uptake, so if you have a compiler dating 1995 or earlier, odds are it
won't have complete support of exceptions.

A similar story goes for other language features (eg the bool type)
as a lot of effort by compiler vendors went into things like templates.

--

0 new messages