Compile time options in Cloud IDE

Is there any way to set compile time options in the cloud? For example, there are a couple cases where I would like my core to throw an exception, but when I compile I get:

exception handling disabled, use -fexceptions to enable

This is not the first time this has come up and I’ve worked around it. I really like using the Cloud IDE so that I can work on it when I’m supposed to be working, but I’d like to be able to do some more complicated things in it. I’d also like to have the option to switch from Arduino to C++. I’ve read that the Core supports C++, but I haven’t found any details on how to make that change.

I’m not sure if there is an __attribute__() or #pragma GCC "-fexceptions", but it might be worth googling.

For my case I had played with the optimizer attributes before like this

  // declare the fn prototype with attribute
  void otherOptFn() __attribute__((optimize("O2")));
  void otherOpFn()
  { ... }
1 Like

Hi @tbridges42,

You should be able to write your typical C++ code in the IDE, just create a new tab (it’ll have a cpp file extension automatically). You’ve actually been writing C++ this whole time, the pre-processor just does some sugar for you in .ino files. :slight_smile: