MRS 的 C++ 支持要努力呀

/opt/gcc-arm/bin/arm-none-eabi-g++ ex.cc --specs=nosys.specs --specs=nano.specs -o arm.elf

/opt/gcc-riscv/bin/riscv-none-elf-g++ ex.cc --specs=nosys.specs --specs=nano.specs -o mrs.elf
../Downloads/xpack-riscv-none-elf-gcc-13.2.0-2/bin/riscv-none-elf-g++ ex.cc --specs=nosys.specs --specs=nano.specs -o xpack.elf

size *.elf
??text ???data ????bss ????dec ????hex filename
?47340 ????120 ????420 ??47880 ???bb08 arm.elf
320970 ???4500 ???7224 ?332694 ??51396 mrs.elf
?47109 ???4288 ????724 ??52121 ???cb99 xpack.elf

可見MRS的C++庫優(yōu)化有問題呀。


附上原始的測試文件:


#include
#include
#include

using namespace std;

void MyFunc(int c)
{
??? if (c > numeric_limits< char> ::max())
??? {
??????? throw invalid_argument("MyFunc argument too large.");
??? }
??? //...
}

// extern "C" void SystemInit()
// {
//
// }

int main()
{
??? try
??? {
??????? MyFunc(256); //cause an exception to throw
??? }

??? catch (invalid_argument& e)
??? {
??????? //cerr << e.what() << endl;
??????? return -1;
??? }
??? //...
??? return 0;
}

您好,感謝反饋,這邊會反饋給相關(guān)同事


只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频