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

Turn on -werror for C code build? #515

Open
jonathanpallant opened this issue Feb 9, 2023 · 3 comments
Open

Turn on -werror for C code build? #515

jonathanpallant opened this issue Feb 9, 2023 · 3 comments

Comments

@jonathanpallant
Copy link

I've spent quite a lot of time chasing down an issue with a new Rust target, which turned out to be the vendor's stdint.h not including UINT64_C. This produced a warning (and a call to an imagined function int UINT64_C(int), because C) but that scrolled past quickly and didn't stop the build.

Perhaps we could enable -Werror on the CC crate when building the C code to catch this kind of things in the future.

@Amanieu
Copy link
Member

Amanieu commented Feb 13, 2023

I would prefer not to. -Werror is extremely brittle because it can cause build failures when the C compiler is updated and introduces new warnings.

@jonathanpallant
Copy link
Author

Can we enable something to catch "using a function that hasn't previously been declared?" That's always a serious bug, surely.

@Amanieu
Copy link
Member

Amanieu commented Feb 13, 2023

Sure, I think it's fine to enable it for specific warnings. Just not a blanket -Werror. Also make sure the compiler in question actually supports flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants