Disabled exceptions, new() operator still throws exception

Asked by Martin Wagner

Hi @all,

I've already had a look at this on the web and disabled exception handling as recommended (see end). However, when I call new(999999), there is still an exception thrown. In debugger "semihosting: exception 0x20023" is shown, without debugger my application just hangs.
I know that I can get around by calling new(nothrow). However, I need to know if there are other exceptions that I don't know about that are also enabled but not handled.

How do I completely disable exception handling?

Thanks,
Martin

1. toolchain version: GNU Tools for ARM Embedded Processors 6-2017-q2-update
When I take a look in the build-toolchain.sh file, "-fno-exceptions" is set for libc++ build.
2. g++ flags (those which I think might be relevant for this):
--specs=nano.specs
--specs=rdimon.specs
-ffunction-sections
-fdata-sections
-fno-rtti
-fno-exceptions
-std=c++11
-lrdimon

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Tejas Belagod (belagod-tejas) said :
#2

Hi,

The -fno-exceptions you see is for the nano lib build - nano does not enable exceptions. You will need to do the same if you want to disable exceptions in your application code - build it with -fno-exceptions. If you don't want to use nano lib, then you will need to build your own set of libs with exceptions disabled.

Thanks,
Tejas.

Revision history for this message
Martin Wagner (marwagner) said :
#3

Hi,

the flag -fno-exceptions is enabled in my application build (see 2. flag list in my opening question).

regards,
Martin

Revision history for this message
Tejas Belagod (belagod-tejas) said :
#4

Hi,

Ah, yes sorry I missed that. Let me try to reproduce this with a small representative application and get back to you.

Thanks,
Tejas.

Can you help with this problem?

Provide an answer of your own, or ask Martin Wagner for more information if necessary.

To post a message you must log in.