mark envoy/, absl/, and api/ as system include prefixes#115
Draft
mark envoy/, absl/, and api/ as system include prefixes#115
Conversation
Pull Request Test Coverage Report for Build 18108646320Details
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because we use the clang safe buffers feature (https://clang.llvm.org/docs/SafeBuffers.html), some external dependency includes need to be wrapped with pragma statements that disable/enable these warnings. We can try using the --system-header-prefix flag (https://github.com/llvm/llvm-project/blob/main/clang/docs/UsersManual.rst#controlling-diagnostics-in-system-headers) to tell clang that certain header prefixes contain "system" headers, which suppresses warnings. The include paths for external envoy headers and our own headers share the same directory structure, and this flag only operates on the include paths as they appear in the source code (instead of the resolved "external/" headers), so by default none of the envoy headers are treated as system headers.
We can add the
envoy/,absl/, andapi/prefixes to the system headers list, since these contain envoy public api definitions, abseil code, and generated api code respectively. We also addsource/common/common/to suppress warnings in envoy common code, andsource/common/buffer/(which most of the warnings originate from), which is fine as long as we don't use these paths in our own code in the future.