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

@align Doesn't Align All Fields For Single-Line Declarations #1266

Closed
Ked29 opened this issue Jul 29, 2024 · 3 comments
Closed

@align Doesn't Align All Fields For Single-Line Declarations #1266

Ked29 opened this issue Jul 29, 2024 · 3 comments
Assignees
Labels
Bug Something isn't working Fixed Needs Verification Fixed, but needs verification that it works

Comments

@Ked29
Copy link

Ked29 commented Jul 29, 2024

After playing around with the language, I wanted to see if it supported the alignment of structs and or fields of said structs. I tried to do this, for example:

struct Vector3
{
     float x, y, z @align(8);
}

However, that only aligns z to 8 bytes.

It does work if you do something like this:

struct Vector3
{
     float x @align(8);
     float y @align(8);
     float z @align(8);
}

Or something like this:

struct Vector3
{
     float x @align(8), y @align(8), z @align(8);
}

It isn't a make-or-break for me, but having that simple QoL feature is quite nice.

@lerno lerno self-assigned this Jul 30, 2024
@lerno lerno added the Bug Something isn't working label Jul 30, 2024
@lerno
Copy link
Collaborator

lerno commented Jul 30, 2024

This is actually a bug. You can try declaring globals in the same way and they all get the same alignment as expected.

@lerno lerno added the Fixed Needs Verification Fixed, but needs verification that it works label Jul 30, 2024
@lerno
Copy link
Collaborator

lerno commented Jul 30, 2024

This should be fixed in master and will appear in the next build.

@Ked29
Copy link
Author

Ked29 commented Jul 30, 2024

Awesome. Thank you for your hard work, I'm very excited to see the growth of this language.

@Ked29 Ked29 closed this as completed Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Fixed Needs Verification Fixed, but needs verification that it works
Projects
None yet
Development

No branches or pull requests

2 participants