Skip to content

[CODE HEALTH] Remove last unused nostd namespace alias in otlp_populate_attribute_utils - #4114

Merged
marcalff merged 1 commit into
open-telemetry:mainfrom
thc1006:codehealth/otlp-populate-alias-decl
Jun 3, 2026
Merged

[CODE HEALTH] Remove last unused nostd namespace alias in otlp_populate_attribute_utils#4114
marcalff merged 1 commit into
open-telemetry:mainfrom
thc1006:codehealth/otlp-populate-alias-decl

Conversation

@thc1006

@thc1006 thc1006 commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

Removes the single remaining misc-unused-alias-decls warning in the project: a file-scope namespace nostd = opentelemetry::nostd; declaration at exporters/otlp/src/otlp_populate_attribute_utils.cc:31.

This declaration was deliberately left in place by #4091 to avoid conflicting with the then in-flight #4090 on the same file. Both have now merged (#4091 by marcalff on 2026-05-18, #4090 by lalitb on 2026-06-01), so the conflict surface is gone.

After this PR, the misc-unused-alias-decls warning count for the project is 0 under both all-options-abiv1-preview and all-options-abiv2-preview.

Why the alias is unused

References to nostd:: inside the OPENTELEMETRY_BEGIN_NAMESPACE block resolve via parent-namespace lookup to opentelemetry::nostd without needing the file-scope alias. The alias was redundant from day one; clang-tidy's misc-unused-alias-decls check correctly flagged it.

There are no global-scope references to nostd:: in this file (only the alias declaration itself, which is removed). Removing it does not affect any include or any other code path. Same pattern as the 29 alias removals in #4091.

Ratchet

  • all-options-abiv1-preview warning_limit lowered from 385 to 384
  • all-options-abiv2-preview warning_limit lowered from 391 to 390

Both presets reported the warning at this site; both ratchets drop by 1.

Verification

Counts measured against artifacts of the most recent successful CI run on main (workflow clang-tidy.yaml, run 26782221265, head 83c135d8):

Preset Before (count / limit) After (predicted)
abiv1-preview 385 / 385 384 / 384
abiv2-preview 391 / 391 390 / 390

Local clang-format --dry-run --Werror against the modified source file: clean.

Test plan

  • CI clang-tidy job passes both abiv1-preview and abiv2-preview at the new limits
  • No behavioral change (declaration removal only, all uses already resolve via namespace nesting)

Part of #2053

@thc1006
thc1006 requested a review from a team as a code owner June 2, 2026 20:06
…te_attribute_utils

Removes the file-scope `namespace nostd = opentelemetry::nostd;` declaration
that was deliberately left in place by PR open-telemetry#4091 to avoid conflicting with the
then in-flight PR open-telemetry#4090 on the same file. Now that both PRs have merged, this
completes the misc-unused-alias-decls cleanup: the project drops from 1 to 0
such warnings.

The alias was unused. References to `nostd::` inside `OPENTELEMETRY_BEGIN_NAMESPACE`
resolve via parent-namespace lookup to `opentelemetry::nostd` without needing the
file-scope alias.

Ratchet:
* abiv1-preview warning_limit lowered from 385 to 384
* abiv2-preview warning_limit lowered from 391 to 390

Part of open-telemetry#2053

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
@thc1006
thc1006 force-pushed the codehealth/otlp-populate-alias-decl branch from cae636a to 02bc457 Compare June 2, 2026 20:06
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.01%. Comparing base (83c135d) to head (02bc457).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4114   +/-   ##
=======================================
  Coverage   82.01%   82.01%           
=======================================
  Files         385      385           
  Lines       16031    16031           
=======================================
  Hits        13146    13146           
  Misses       2885     2885           
Files with missing lines Coverage Δ
...xporters/otlp/src/otlp_populate_attribute_utils.cc 92.96% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcalff
marcalff merged commit 58ca2a4 into open-telemetry:main Jun 3, 2026
71 checks passed
@thc1006
thc1006 deleted the codehealth/otlp-populate-alias-decl branch June 3, 2026 06:42
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