Skip to content

Includes of gtest with < > instead of " ". #380

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gruenich
Copy link
Contributor

Found by Cppcheck (missingInclude).

Found by Cppcheck (missingInclude).
@gruenich gruenich force-pushed the feature/cppcheck-warnings branch from d43619f to 32d348a Compare February 22, 2025 10:19
@gruenich
Copy link
Contributor Author

Can I spark your interested in this humble improvement, @gchatelet ?

@Mizux
Copy link
Collaborator

Mizux commented Feb 24, 2025

AFAIK bazel use -I and not -isystem so using <...> should break the bazel based build

@gruenich
Copy link
Contributor Author

It should not matter to be included by -I or -isystem, the difference is only that the latter suppresses warnings from those includes.

The main difference is that according to POSIX qutation marks leads to a search relative to the file while the bracets searche relative to the includes (-I), see
https://stackoverflow.com/a/11576616/2799037

@gchatelet
Copy link
Collaborator

Indeed it should not matter to use -I or -isystem but if we are to use <...> then we also need to move the include above the "..." includes.

https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants