Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple enumerator attributes #21

Closed
lambdageek opened this issue Feb 14, 2017 · 0 comments
Closed

Add support for multiple enumerator attributes #21

lambdageek opened this issue Feb 14, 2017 · 0 comments

Comments

@lambdageek
Copy link

lambdageek commented Feb 14, 2017

From GCC documentation on attribute syntax:

In GNU C, an attribute specifier list may appear as part of an enumerator. The attribute goes after the enumeration constant, before =, if present. The optional attribute in the enumerator appertains to the enumeration constant. It is not possible to place the attribute after the constant expression, if present.

where attribute specifier list is multiple attribute specifiers with no intervening tokens.

OSX /usr/include/time.h has multiple __attribute__((availability(...))) attributes stacked on each enumerator:

typedef enum {
_CLOCK_REALTIME __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) = 0,
}

where __OSX_AVAILABLE(_vers) is __attribute__(((macosx,introduced=_vers))) and similarly for the others.

@lambdageek lambdageek changed the title Add support for enumerator attributes (GCC extension) Add support for multiple enumerator attributes Feb 15, 2017
@visq visq closed this as completed in #23 Feb 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant