cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

Fixes for arm-none-eabi-g++

Open matgla opened this issue 1 year ago • 1 comments
trafficstars

Typeid cannot be used when -fno-rtti is used. Fixed compilation of generated sources on arm-none-eabi-g++ 13.1.

matgla avatar Mar 29 '24 22:03 matgla

Hi, I just wanted to raise issue that fix is necessary for -fno-rtti + -fno-exception builds. Usage of PRETTY_FUNCTION and MSVC FUNCSIG is a little bit hacky I think, so maybe it's better to print just exception without type.

arm-none-eabi-g++ also fails on std::string to const char* conversion.

Gotbolt link with example usage compile time type_name : https://godbolt.org/z/75fnc5Krq

Real use example: 09:47:22.2417 [INFO] uart0: [host: 81.23ms (+1.83ms)|virt: 0.2ms (+0.2ms)] Type safety violation: Throw exception (-fno-exception) with type "std::error_condition&&" and the message "'fopen' attempt failed"

matgla avatar Mar 29 '24 22:03 matgla

Thanks! That's quite cute.

It looks like this may be your first contribution to cppfront. I've sent the Contributor License Agreement (CLA) to your email, and once it's signed I can look in more detail at your pull request. Thanks again for your contribution.

hsutter avatar May 08 '24 00:05 hsutter

Looks, good, thanks!

hsutter avatar May 11 '24 23:05 hsutter