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

Allow to describe bitfields in a struct template #72

Closed
xairy opened this issue Sep 15, 2016 · 4 comments
Closed

Allow to describe bitfields in a struct template #72

xairy opened this issue Sep 15, 2016 · 4 comments

Comments

@xairy
Copy link
Collaborator

xairy commented Sep 15, 2016

Not sure how the syntax should look like.
Maybe something like this:

my_struct {
  field_1  const[1, int8] : 4
  field_2  int8 : 4
  field_3  int16 : 3
  field_4  int16[0:20] : 13
}
@dvyukov
Copy link
Collaborator

dvyukov commented Sep 15, 2016

Please also post here some examples of where it is necessary. E.g. do we need to support consts, flags? Something else?

@xairy
Copy link
Collaborator Author

xairy commented Sep 15, 2016

We probably need to support const, flags and general integers (int8, int16, ...).

@xairy
Copy link
Collaborator Author

xairy commented Dec 20, 2016

Proposed syntax:

my_struct {
  field_1  const[1, int8:4]
  field_2  int8:4
  field_3  len[parent, int16:3]
  field_4  int16:13[0:20]
}

@xairy xairy closed this as completed in 54e0ced Jan 17, 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

2 participants