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

best practices: enabling warnings ... in practice #445

Open
oschonrock opened this issue Dec 13, 2024 · 0 comments
Open

best practices: enabling warnings ... in practice #445

oschonrock opened this issue Dec 13, 2024 · 0 comments

Comments

@oschonrock
Copy link

oschonrock commented Dec 13, 2024

Channel

"C++Weekly"

Topics

best practices: enabling warnings ... in practice: External dependencies, controlling warnings for each TU with build systems, what about external header only libraries? What about c-libaries? Or worse: header only c-libaries?

A lot of code out there is compiled with -Wall -Wextra, but most of it not with -Wconversion and -Wsign-conversion (just for example) which are important. If you enable these, you will likely be met with a flood of warnings. Just trying to address the ones in your own code is a somewhat laborious task, but it is made harder by the ones from included dependencies, to the point where you can't see the wood for the trees.

Ideally: Solutions for "firewalling off / compartmentalising" warnings from external dependencies in each of the above cases. Compiler switches to "ignore certain headers or apply lesser warnings", do they exist?

What about taming warnings from clang-tidy/clangd in these scenarios, so that not only is your actual compile clean, but also your IDE is happy.

Seems like an important topic if the eco-system is going to make progress towards higher adherence to best practices overall?

Even if your own project is greenfield, and you start with lots of warnings enabled, the chance that all the dependencies you choose will also have them enabled is near nil?

Length

could be done in < 10mins I think, but it depends on how far you want to take it.

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

1 participant