looking for compilers and/or platforms **without** C++ exception support

B

Bill Davidson

Hi there,

Please forgive me for posting this article on multiple groups.
Being new in the newsgroups, I was not sure which group would
have been appropriate for my question. Sorry.

My Question
-----------
I am looking for a list of popular compilers and/or platforms that
*do not* support native C++ exceptions. Any pointers in this
regard is appreciated.

Best Regards,
Bill
 
D

Dhruv

Hi there,

Please forgive me for posting this article on multiple groups.
Being new in the newsgroups, I was not sure which group would
have been appropriate for my question. Sorry.

My Question

Convince gcc porters to stop work dead, and you'll have quite a few
OSes...


-Dhruv :)




Hello
 
A

Adam Fineman

Bill Davidson wrote:

I'm not sure why you cross-posted this to newsgroups without 'c++' in
their names.... I've reduced the list of ng's.
My Question
g++ has options like -fno_exceptions that may do what you want. It
won't fail to compile valid exception code, but it will not generate the
associated assembly.

See the manpage for details.

Adam
 
N

news user

Bill said:
Hi there,

Please forgive me for posting this article on multiple groups.
Being new in the newsgroups, I was not sure which group would
have been appropriate for my question. Sorry.

My Question

Microsoft embedded C++ 3.0 (eVC 3)
 
W

Walter

Bill Davidson said:
I am looking for a list of popular compilers and/or platforms that
*do not* support native C++ exceptions. Any pointers in this
regard is appreciated.

Many C++ compilers for 16 bit DOS do not support exception handling,
templates or RTTI (but Digital Mars C++ does).
 
J

Jack Klein

Hi there,

Please forgive me for posting this article on multiple groups.
Being new in the newsgroups, I was not sure which group would
have been appropriate for my question. Sorry.

My Question
-----------
I am looking for a list of popular compilers and/or platforms that
*do not* support native C++ exceptions. Any pointers in this
regard is appreciated.

Best Regards,
Bill

Since you posted to comp.arch.embedded with such a hopelessly vague
question, there are quite a few architectures with no C++ compilers at
all, so they certainly do not support native, or foreign, C++
exceptions.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
 
D

Daniel James

Bill Davidson said:
I am looking for a list of popular compilers and/or platforms that
*do not* support native C++ exceptions. Any pointers in this
regard is appreciated.

It seems a strange question - what for?

The C++ language is now defined by an ISO standard. The language specified in
that standard /does/ support exceptions, and the runtime library described in the
standard /does/ use exceptions. Any compiler that doesn't support them isn't C++
(not standard C++, anyway).

Maybe that's the answer you're looking for? Non-C++ compilers don't support
native C++ exceptions. Fortran compilers, for example.

If, on the other hand, your question is really "how widespread are C++-subset
compilers that don't support exceptions" or "if I use exceptions in my code will
my code be significantly less portable than if I don't use them" then the answer
is that all modern compilers on desktop platforms do support exceptions, as do
the better embedded ones. I would expect this situation to improve as compilers
continue to be updated to include more of the provisions of the standard.

- I believe that the Microsoft compilers targetting Windows CE currently
don't support exceptions (is that still true? It seems a strange
omission),

- Visual C++ for 16-bit platforms didn't support excpetions (but had
an exception-like system without stack unwinding kludged with longjump).

- C++ on the Symbian platform does not use exceptions (because it depends
upon an old version of the gcc cross-compiler which is deficient in
exception support) and so has its own error-handling mechanism. Porting code
to/from Symbian is a fairly major undertaking because Symbian provides a large
runtime library that is peculiar to the Symbian platform, support for
exceptions will be the least of your worries.

All the C++ compilers I'm aware of for Windows and/or linux do support
exceptions.

Unless you have a particular compiler or platform in mind that you know does not
support exceptions I would go ahead and use them. In my experience the use of
exceptions leads to clearer code and more robust error handling than the
alternatives.

Daniel James | djng
Sonadata Limited, UK | at sonadata
| dot co dot uk
 
T

Tim Clacy

Bill said:
Hi there,

Please forgive me for posting this article on multiple groups.
Being new in the newsgroups, I was not sure which group would
have been appropriate for my question. Sorry.

My Question
-----------
I am looking for a list of popular compilers and/or platforms that
*do not* support native C++ exceptions. Any pointers in this
regard is appreciated.

Best Regards,
Bill

ARM - ARM Developer Suite (ADS) 1.2
ARM - RealView Compilation Tools (RVCT) 2.0
 
P

Paul Keinanen

It seems a strange question - what for?

The wording looks quite strange, but considering that the realtime and
embedded newsgroups are included, I would guess that the original
poster is considering situations in which exception handling is not
desirable.

A compiler that does not support exceptions will not generate
exceptions at run time :).

I think that the more relevant question in the embedded and/or
realtime environment is that, can a compiler that supports exception
handling be configured in such a way that it does not generate
exceptions ? This is especially important regarding the run time
libraries, such as "new".

The exceptions can not be disabled, then the use of C++ in some
situations is out of the question.

Paul
 
P

P.J. Plauger

The wording looks quite strange, but considering that the realtime and
embedded newsgroups are included, I would guess that the original
poster is considering situations in which exception handling is not
desirable.

A compiler that does not support exceptions will not generate
exceptions at run time :).

I think that the more relevant question in the embedded and/or
realtime environment is that, can a compiler that supports exception
handling be configured in such a way that it does not generate
exceptions ? This is especially important regarding the run time
libraries, such as "new".

The exceptions can not be disabled, then the use of C++ in some
situations is out of the question.

Right. Some compilers, particularly in the embedded world, do indeed
permit exceptions to be disabled. That can lead to code that is smaller
or faster (or both). Or it can simply permit the use of C++ in a
project that outlaws exceptions for safety reasons (whether justified
or not). If you want to use a compiler that can disable exceptions,
then you also need a library that can work that way. We provide such
a creature, which is one of the reasons why so many embedded compilers
ship with our library. I believe one or two other libraries do too.
But if the library that comes with your compiler doesn't work properly
in the absence of exception handling, your only choice is not to use
the library.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
R

R.F. Pels

Bill said:
I am looking for a list of popular compilers and/or platforms that
*do not* support native C++ exceptions. Any pointers in this
regard is appreciated.

The notion of 'native' is not clear to me, however, it might mean three
things IMHO, either

1. the compiler does not know the concept of exceptions (it is not native
to the compiler implementation) and therefore does not support
try/catch
2. the compiler does not know that the platform it generates code for
has a particular exception mechanism as for example the structured
exception mechanism of Windows NT or a similar architecture in VMS
(one of the signs showing heritage)
3. the platform on which the code runs does not know an exception
mechanism, most if not all UNIXen.

In case #1, that would be a pretty old compiler I would say. Case #2, I
would say could be versions of the Borland C++ compilers, that indeed make
use of the structured exception handling mechanism but only in a limited
way, meaning that they /do/ use structured exception handling for
propagating exceptions by using a structured exception with the 0x0EEFFACE
number (or 0x0EEDFACE for Delphi), and in case #3, the exception handling
mechanism is almost always 'emulated' in some sense.

What is very instructive in the last case is what code a compiler inserts at
the start of a try/catch block. I think I am not far from reality if in
most cases a register is reserved for pointing to the current exception
handler while outer exception handlers are kept in a stack, much like
structured exception handling in Windows NT.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top