Skip to content

Comments

IWYU - Clean up unused includes and forward declarations#5350

Draft
KaganCanSit wants to merge 1 commit intorandombit:masterfrom
KaganCanSit:iwyu-header-and-forward-declaration-cleanup
Draft

IWYU - Clean up unused includes and forward declarations#5350
KaganCanSit wants to merge 1 commit intorandombit:masterfrom
KaganCanSit:iwyu-header-and-forward-declaration-cleanup

Conversation

@KaganCanSit
Copy link
Contributor

@KaganCanSit KaganCanSit commented Feb 16, 2026

Hello,

I am aware that improving the project's compilation time and cleanliness is currently a high priority. With the help of IWYU, I have identified some points. I hope this helps.

Frankly, I'm not sure about some points. I'll mark them as draft. (wmmintrin/immintrin)

Changes:

  • Replace <wmmintrin.h> with <immintrin.h> in aes_vaes.cpp (covers VAES 256-bit intrinsics)
  • Replace <immintrin.h> with <emmintrin.h> in zfec_sse2.cpp (SSE2-only module)
  • Remove redundant <cstdint> includes where botan/types.h provides coverage
  • Remove unused <memory>, <string>, <algorithm>, <cstddef> includes
  • Remove dead forward declarations: Barrett_Reduction, Kyber_Keypair_Codec, Sphincs_Address, BLAKE2bMAC, Classic_McEliece_Polynomial_Ring, Classic_McEliece_Big_F_Coefficient, EC_Group_Data, RandomNumberGenerator

I didn't encounter any errors during compilation and testing in the Linux environment, but I will look at the CI. Additionally, if there is any point you would like me to revise, please leave a comment and I will look into it.

Regards.


Note: Additionally, I saw the following warnings. It compiles when I make changes, but I didn't want to add them because I wasn't sure.

//build/include/public/botan/p11_randomgenerator.h should remove these lines:
- namespace Botan { namespace PKCS11 { class Module; } }
//build/include/public/botan/p11_object.h should remove these lines:
- namespace Botan { namespace PKCS11 { class Module; } }
 
// Already defines inside the p11_types.h

@coveralls
Copy link

coveralls commented Feb 16, 2026

Coverage Status

coverage: 90.335% (-0.001%) from 90.336%
when pulling cc6ba53 on KaganCanSit:iwyu-header-and-forward-declaration-cleanup
into 90b85a8 on randombit:master.

@KaganCanSit KaganCanSit force-pushed the iwyu-header-and-forward-declaration-cleanup branch from d4af290 to cc6ba53 Compare February 24, 2026 17:42
@KaganCanSit
Copy link
Contributor Author

Hit by #5382, rebase to master branch.

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