Commit e649c7f
authored
[CODE HEALTH] Move func_grpc_main classes into anonymous namespace (#4129)
Wraps the 3 file-scope class and struct declarations in
functional/otlp/func_grpc_main.cc within an anonymous namespace to
give them internal linkage and clear the misc-use-internal-linkage
warnings clang-tidy reports on this file.
The wrap covers TestResult (line 63), TestLogHandler (line 128), and
test_case (line 316). It deliberately ends BEFORE the static int
test_*() forward declarations at line 322+.
This boundary follows the same pattern as #4128 (func_http_main):
the test_*() declarations are matched by definitions in the lower
half of the file (after main()). Wrapping the declarations alone
would create (anonymous namespace)::test_* symbols that fail to
link against the file-scope static test_*() definitions. Local
verification: build of func_otlp_grpc target with
WITH_OTLP_HTTP=ON + WITH_OTLP_GRPC=ON succeeded 122/122 ninja steps;
--help smoke test prints usage as expected.
main() and all test_*() infrastructure (declarations, the
all_tests[] table, list_test_cases, run_test_case, and definitions)
remain at file scope with their existing static linkage.
Ratchet:
* abiv1-preview warning_limit lowered from 349 to 346
* abiv2-preview warning_limit lowered from 353 to 350
Part of #2053
Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>1 parent 5791b30 commit e649c7f
3 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
| 325 | + | |
| 326 | + | |
322 | 327 | | |
323 | 328 | | |
324 | 329 | | |
| |||
0 commit comments