I posted other question: What type should I use for binary representation of C enum?, and by the answer, I have to know my compiler’s enum data-type.
What’s the data-type of C enum on Clang compiler?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Like most (all, maybe) C compilers, the size of an enumerated type can vary. Here’s an example program and its output:
Output:
All that the standard requires is:
A quick web search didn’t turn up a clang manual that specified its behaviour, but one is almost certainly out there somewhere.