You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
Breaking changes
The compiler now defaults to the behavior of -fshort-enums. enum types without explicitly specified types now take on the smallest integer type in which they will fit. This generally decreases the space and time overhead of enums, and this choice is common on embedded targets. The old behavior is still available through -fno-short-enums, but it now represents a non-standard ABI, and translation units using this option cannot be guaranteed compatible with those using the default, e.g., the SDK. The new default also comes with a few additional points of care:
Changes to the set of enum values can break ABI in more cases than previously
Since short and int are the same size on our platform, but are not the same type, a pointer to an enumerator that contains values that only fit in int is now only compatible with a pointer to short, not a pointer to int. Even though these are effectively the same type on our platform, the C standard still rules it undefined behavior to access such an enum through a pointer to int, or to use them in a context where compatible types are expected, e.g., on two branches of the ternary operator.