|
|
Re: No Exceptions cuaght C++ [message #1794461 is a reply to message #1794458] |
Thu, 30 August 2018 21:17 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Don't have much time to experiment but:
o) Check the specs files to make sure exceptions aren't being turned off.
o) bit of a reach buy try temporarily removing the -fno-rtti
the last because:
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options
Quote:
-fno-rtti
Disable generation of information about every class with virtual functions for use by the C++ run-time type identification features (dynamic_cast and typeid). If you don't use those parts of the language, you can save some space by using this flag. Note that exception handling uses the same information, but G++ generates it as needed
Maybe the "but" part of the documentation somehow doesn't apply.
Update: what David Wegener said, too. Likely the real reason.
[Updated on: Thu, 30 August 2018 21:26] Report message to a moderator
|
|
|
Re: No Exceptions cuaght C++ [message #1794524 is a reply to message #1794460] |
Fri, 31 August 2018 20:26 |
Julius Caesar Messages: 7 Registered: March 2018 |
Junior Member |
|
|
@david:
yes you are completely right my code sample was wrong
here is a right one
try
{
throw std::bad_alloc();
} catch (const exception& ex)
{
bad_alloc_exception_count++;
}
All Exceptions are either std exceptions or exceptions which are derived from std:runtime_error (which itself is derived form std:exception)
Therefore this catch block should catch the exception above
@(other ;))david
What do you mean by
Quote:Check the specs files to make sure exceptions aren't being turned off.
Which specs files do you mean?
I tried removing the -fno-rtti but i'm still running into the termination handler
make -j4 all
Building file: ../Src/User/debug/CCustom_Exception.cpp
Invoking: MCU G++ Compiler
xxxx\Debug
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c++1y '-D__weak=__attribute__((weak))' '-D__packed=__attribute__((__packed__))' -DUSE_HAL_DRIVER -DSTM32F429xx -O2 -g3 -pedantic -Wall -Wextra -Wconversion -fexceptions -ffunction-sections -c -MMD -MP -MF"Src/User/debug/CCustom_Exception.d" -MT"Src/User/debug/CCustom_Exception.o" -o "Src/User/debug/CCustom_Exception.o" "../Src/User/debug/CCustom_Exception.cpp"
Finished building: ../Src/User/debug/CCustom_Exception.cpp
Building target: Giessomat.elf
Invoking: MCU G++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L"C:\Users\Julian\Giessomat\uC\Giessomat\Middlewares\ST\STemWin\Lib" -fexceptions -specs=nosys.specs -specs=nano.specs -u_printf_float -T"../STM32F429ZITx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "Giessomat.elf" @"objects.list" -lSTemWin532_CM4_OS_GCC -lm
Finished building target: Giessomat.elf
Any other ideas?
Thx for your help so far :)
[Updated on: Fri, 31 August 2018 20:29] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03351 seconds