Pages: [1]   Go Down
Author Topic: -fshort-enums  (Read 998 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Sofia, Bulgaria
Offline Offline
Full Member
***
Karma: 0
Posts: 237
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just looked at the Makefile (Arduino 015) and there is this line:
CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA)

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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Pages: [1]   Go Up
Jump to: