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

Abbreviate all-zero INIT macros as {0}? #423

Closed
kainino0x opened this issue Nov 18, 2024 · 2 comments
Closed

Abbreviate all-zero INIT macros as {0}? #423

kainino0x opened this issue Nov 18, 2024 · 2 comments
Labels
non-breaking Does not require a breaking change (that would block V1.0)

Comments

@kainino0x
Copy link
Collaborator

kainino0x commented Nov 18, 2024

Many of the INIT values (for base/standalone structs) will actually be all-zero, so equivalent to zero-initialization {}.
For those we could reduce the size of the header by just generating {} instead.

INIT structs are issue #158, PR #422

@kainino0x kainino0x added the non-breaking Does not require a breaking change (that would block V1.0) label Nov 18, 2024
@eliemichel
Copy link
Collaborator

It seems that {} is not valid in C (it is reported by CI to be a non-standard GNU extension), we should rather use {0}.

@kainino0x kainino0x changed the title generator: INIT structs which are all-zero could just be {} Abbreviate all-zero INIT macros as {0}? Nov 21, 2024
@kainino0x
Copy link
Collaborator Author

Discussed on #427:

  • Should we have INIT macros when they are equivalent to zero-init, and therefore not really necessary? (see also "Abbreviate all-zero INIT macros as {0}? #423")
    • Keep for same reason
    • CF: Think we should not abbreviate. They're a form of documentation.

@kainino0x kainino0x closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-breaking Does not require a breaking change (that would block V1.0)
Projects
None yet
Development

No branches or pull requests

2 participants