本文介绍了在Arduino环境中启用异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据,理论上可以在Arduino板上运行特殊二进制文件。



我如何更改我的Arduino IDE允许这个?具体来说,如何在调用编译器时阻止IDE包含 -fno-exceptions 标志?

解决方案

Arduino IDE将 -fno-exceptions 传递给使用的编译器( avr-gcc )。这样做是因为编译器的文档指定它是必需的(请参阅)。



因为这个参数是必需的(正确的或错误地)为了编译器的正常运行,Arduino IDE不提供改变这种方式。



然而,如果你想尝试删除这个参数来看看有什么效果您需要编辑Arduino源代码(目前在)并自行重建IDE。 p>

According to an answer to a question about whether the arduino environment supports exceptions, it is theoretically possible to run "exceptional" binaries on an Arduino board.

How would I alter my Arduino IDE to allow this? Specifically, how do I prevent the IDE from including the -fno-exceptions flag when invoking the compiler?

解决方案

The Arduino IDE passes -fno-exceptions to the compiler it uses (avr-gcc). It does this because the compiler's documentation specifies that it is required (see http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus).

Since this parameter is required (rightly or wrongly) for correct functioning of the compiler the Arduino IDE does not provide a way to change this.

Nevertheless, if you want to try removing this parameter to see what effect it has you'll need to edit the Arduino source code (currently line 589 in https://github.com/arduino/Arduino/blob/master/app/src/processing/app/debug/Compiler.java) and rebuild the IDE yourself.

这篇关于在Arduino环境中启用异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 01:40