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

Handle _Static_assert gracefully. Closes #276 #277

Merged
merged 7 commits into from
Jul 9, 2020

Conversation

thedataking
Copy link
Contributor

Without this PR, the c2rust transpiler barfs on translation units that use this feature. With it, we emit a warning instead.

@thedataking thedataking requested a review from ahomescu July 8, 2020 08:24
@thedataking thedataking changed the title Handle _Static_assert gracefully Handle _Static_assert gracefully. Closes #276 Jul 8, 2020
c2rust-transpile/src/c_ast/iterators.rs Outdated Show resolved Hide resolved
c2rust-transpile/src/c_ast/iterators.rs Outdated Show resolved Hide resolved
c2rust-transpile/src/c_ast/iterators.rs Outdated Show resolved Hide resolved
@@ -857,6 +857,13 @@ class TranslateASTVisitor final
abort();
}

bool VisitStaticAssertDecl(StaticAssertDecl *SAD) {
std::vector<void *> childIds = {SAD->getAssertExpr(), SAD->getMessage()};
auto T = QualType(); // don't care about the type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a separate variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, but if I just pass QualType() as the 4th argument how do I communicate that we don't care about this parameter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the comment to that line?

@thedataking thedataking merged commit c04009f into master Jul 9, 2020
@thedataking thedataking deleted the feature/static_assert branch July 9, 2020 04:29
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

Successfully merging this pull request may close these issues.

2 participants