Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22004

How to force enum size with GCC? [duplicate]

$
0
0

This question already has an answer here:

To ensure binary compatibility with the product I'm working on, I need to force some of my enums to be represented by a single byte.

Since C90 allows for the compiler to chose an appropriate type (6.7.2.2 Enumeration specifiers), I would like to force the compiler to chose 8 bits.

I did expect GCC attributes to allow this, but I could not find anything here. Is there another way to handle this? (or an attribute I missed)

I'm using GCC 4.6.4 for Microblaze and C90 (I did not see a relevant option here either).


Viewing all articles
Browse latest Browse all 22004

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>