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

Implement @align in C backend #26

Open
Gankra opened this issue Jun 30, 2024 · 1 comment
Open

Implement @align in C backend #26

Gankra opened this issue Jun 30, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Gankra
Copy link
Owner

Gankra commented Jun 30, 2024

kdl-script supports an align attribute, which the rust backend implements. The C backend should implement it too (currently it bails if it finds any attributes at all, pending implementations like this one). Currently the C backend contains a commented-out version of the rust impl, so you can roughly see what should be done:

"c doesn't support attrs yet".to_owned(),
))?;
}
/*
let mut default_c_repr = true;
let mut repr_attrs = vec![];
let mut other_attrs = vec![];
for attr in attrs {
match attr {
Attr::Align(AttrAligned { align }) => {
repr_attrs.push(format!("align({})", align.val));

The main issue is picking the attribute to use, perhaps by checking what compiler we're using. I know there's like, way too many different attributes here. Someone with more C experience than me hopefully has Opinions on which to use where.

@Gankra Gankra added enhancement New feature or request help wanted Extra attention is needed labels Jun 30, 2024
@Gankra Gankra added the good first issue Good for newcomers label Jun 30, 2024
@Gankra
Copy link
Owner Author

Gankra commented Jun 30, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant