Go Down

Topic: -fshort-enums (Read 2034 times) previous topic - next topic

Coding Badly

I'd like to include the "-fshort-enums" when building.

Short of recompiling the IDE, does anyone know how to pass an option to the compiler via the IDE?


I just looked at the Makefile (Arduino 015) and there is this line:

Where CEXTRA seems to not be set. So probably you can export that variable to your environment, ant it will be used as a flag for the compiler.

Coding Badly

Thanks.  I'll give it a spin and see what happens...

Coding Badly

No luck.  The Arduino IDE doesn't use the makefile.

The code of interest is in Compiler.java / getCommandCompilerCPP method.  It's clear there's no way to inject compiler options at that point.  I haven't been able to find a pragma or other compiler directive to enable short-enums.   :'(

I'll have to do enums "long hand" unless someone has another suggestion.  Any ideas?

Go Up