Skip to content

Conversation

@adsnaider
Copy link

Not a problem when building with cargo proper but when we are using rules_rust in bazel, it uses our C toolchain which we use with -Wundef and -Werror, causing a compilation failure. This fixes the issue by using the defined preprocessor statement (https://gcc.gnu.org/onlinedocs/cpp/Defined.html)

@nagisa
Copy link
Member

nagisa commented Jan 27, 2026

Thank you for contributing. This change still needs test coverage.

@adsnaider
Copy link
Author

Sure. @nagisa what are you hoping to test exactly?

@nagisa
Copy link
Member

nagisa commented Jan 27, 2026

Well, if there are conditions under which the build fails, then a test added here would have to be failing before this change and passing after it. This probably can be as simple as somehow forcing -Wundef -Werror in one/all of the gh workflows, possibly via a CFLAGS or similar env var that the cc crate looks at.

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