[CODE HEALTH] Fix clang-tidy misc-use-internal-linkage warnings#3985
Merged
marcalff merged 5 commits intoopen-telemetry:mainfrom Apr 13, 2026
Merged
Conversation
Mark list_test_cases in func_grpc_main as static, and make the thread_local RNG in circular_buffer_benchmark explicitly static. The foo_library functions in the common example libraries are exported via headers and linked into multiple example binaries, so internal linkage is not possible; suppress those two with NOLINTNEXTLINE instead. Decrement clang-tidy warning limits by 4 to match the fewer unique warnings. Fixes open-telemetry#3977 Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
3 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3985 +/- ##
==========================================
- Coverage 90.18% 90.14% -0.04%
==========================================
Files 230 230
Lines 7299 7299
==========================================
- Hits 6582 6579 -3
- Misses 717 720 +3 🚀 New features to boost your workflow:
|
dbarker
reviewed
Apr 10, 2026
Member
dbarker
left a comment
There was a problem hiding this comment.
Thanks for the cleanup! A few minor comments about the missing header includes which should fix the foo_library warnings.
Addresses review feedback on open-telemetry#3985. The clang-tidy misc-use-internal-linkage warning for foo_library() was triggered because the .cc files did not include their own header, so clang-tidy could not see the external declaration. Including the header is the right fix and lets the NOLINTNEXTLINE suppressions be removed. Uses the same BAZEL_BUILD vs CMake include path split already used by every example main file that calls foo_library(). Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
dbarker
approved these changes
Apr 13, 2026
Member
dbarker
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the contribution!
marcalff
approved these changes
Apr 13, 2026
Member
marcalff
left a comment
There was a problem hiding this comment.
LGTM, thanks for the cleanup.
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.
Fixes #3977
marked
list_test_casesinfunc_grpc_main.ccas static since it is only called in the same TU, and addedstaticto thethread_localRNG incircular_buffer_benchmark.cc. the twofoo_libraryfunctions inexamples/common/foo_libraryandexamples/common/logs_foo_libraryare exported via headers and linked into many example binaries, so internal linkage is not possible there. suppressed those with NOLINTNEXTLINE.also decremented the clang-tidy warning limits by 4 to match the reduced unique warning count, consistent with prior code-health PRs.
keeping as draft until clang-tidy CI confirms the new limits are correct.
Changes
misc-use-internal-linkagewarnings.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes