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

Unified alignment macros #1011

Open
shirok opened this issue Apr 5, 2024 · 0 comments
Open

Unified alignment macros #1011

shirok opened this issue Apr 5, 2024 · 0 comments

Comments

@shirok
Copy link
Owner

shirok commented Apr 5, 2024

Currently we rely on GCC's __attribute__((aligned ...)) feature for some internal types that requires certain alignments. Macros such as SCM_ALIGN8 and SCM_ALIGN_PAIR hides the details (in gauche.h).

C11 has _Alignas so we want to use it for portability. However, it can only be used for variables or struct members but not in a part of typedef, so we can't simply use it in our macros, which is used for both variable definitions and typedefs.

We can either:

  • Replace occurrence of SCM_ALIGN... macros to ensure they are always used for variable/member definitions
  • Add a separate macro to be used for varaible/member definitions.
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