FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Short Enum Type (16Bits)

Altera_Forum
Honored Contributor II
833 Views

Hi, 

In Altera NiosII Eclipse compiler, the enum type is defualt to 4 bytes in size. Is there any# pragma or compiler control that force the enum type size to 2 bytes? 

If not, is there any way to define an enum type as 2 bytes data type in altera? 

Thank you, 

oneplusone
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
121 Views

Hi, 

 

I've never used it but GCC has the -fshort-enums option, which tells the compiler to make shorts out of your enums. 

 

Maybe it's worth to try it.... 

 

Philipp
Reply