-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[POC] cmake: Add option to run include-what-you-use
with compiler
#1204
Conversation
Oh, this may indeed be helpful. I haven't tested anything yet, but if this helps towards #1039, I'm interested. |
Rebased on top of the #1113. |
I fear For example, it suggests:
We don't want to include Also, it suggests includes only for .c files and not for .h files... If we want to have self-contained files, it may be much better to simply check that every file complies individually as suggested in #924. |
For example:
|
Sure, it is not a panacea. However, it can be useful. For instance, consider the demo branch (a mix with #1231):
|
True. And it can be achieved and nicely self documented as follows: /* IWYU pragma: begin_exports */
#if defined(SECP256K1_WIDEMUL_INT128)
#include "field_5x52_impl.h"
#elif defined(SECP256K1_WIDEMUL_INT64)
#include "field_10x26_impl.h"
#else
#error "Please select wide multiplication implementation"
#endif
/* IWYU pragma: end_exports */ FWIW, another demo branch has no IWYU diagnostics for |
Concept ~0. Cores experience with IWYU has been mixed. We've found plenty of bugs/nonsensical include suggestions, and it's not ideal if by default you have to add comments all over the code. We should probably look at migrating to something else, maybe LLVMs Generally I'm not sure that "convenience option for running an include fixer" is something that needs to exists in libsecp256k1s build system. Running |
I agree with that. For example,
Closing. |
IWYU could be useful for developers, e.g., #924 etc.
Example of usage on Ubuntu 22.04: