Skip to content

[CODE HEALTH] clang-tidy bugprone-throwing-static-initialization warnings #4197

Description

@dbarker

This issue covers resolving the bugprone-throwing-static-initialization warnings.

bugprone-throwing-static-initialization (81 warnings) - Click to expand ----
File Line Message
opentelemetry-cpp/api/include/opentelemetry/baggage/baggage_context.h 16 initialization of 'kBaggageHeader' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/api/include/opentelemetry/common/key_value_iterable_view.h 42 initialization of 'value' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/api/include/opentelemetry/trace/span_context_kv_iterable_view.h 51 initialization of 'value' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/configuration/main.cc 61 initialization of 'yaml_file_path' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/file_log_main.cc 44 initialization of 'opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/file_log_main.cc 45 initialization of 'log_opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/file_main.cc 30 initialization of 'opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/file_metric_main.cc 37 initialization of 'exporter_options' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/grpc_log_main.cc 42 initialization of 'opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/grpc_log_main.cc 43 initialization of 'log_opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/grpc_main.cc 29 initialization of 'opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/grpc_metric_main.cc 45 initialization of 'exporter_options' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/http_instrumented_main.cc 155 initialization of 'tracer_opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/http_instrumented_main.cc 156 initialization of 'meter_opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/http_instrumented_main.cc 157 initialization of 'logger_opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/http_log_main.cc 47 initialization of 'trace_opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/http_log_main.cc 93 initialization of 'logger_opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/http_main.cc 33 initialization of 'opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/otlp/http_metric_main.cc 40 initialization of 'exporter_options' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/examples/zipkin/main.cc 31 initialization of 'opts' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/exporters/prometheus/src/exporter_utils.cc 294 initialization of 'INVALID_CHARACTERS_PATTERN' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/exporters/prometheus/src/exporter_utils.cc 295 initialization of 'CHARACTERS_BETWEEN_BRACES_PATTERN' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/exporters/prometheus/src/exporter_utils.cc 296 initialization of 'SANITIZE_LEADING_UNDERSCORES' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/exporters/prometheus/src/exporter_utils.cc 297 initialization of 'SANITIZE_TRAILING_UNDERSCORES' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/exporters/prometheus/src/exporter_utils.cc 298 initialization of 'SANITIZE_CONSECUTIVE_UNDERSCORES' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/exporters/zipkin/src/recordable.cc 43 initialization of 'kSpanKindMap' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h 42 initialization of 'kDefaultHttpConnTimeout' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h 43 initialization of 'kHttpStatusRegexp' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h 44 initialization of 'kHttpHeaderRegexp' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/functional/otlp/func_grpc_main.cc 54 initialization of 'opt_endpoint' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/functional/otlp/func_grpc_main.cc 344 initialization of 'all_tests' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/functional/otlp/func_http_main.cc 53 initialization of 'opt_endpoint' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/functional/otlp/func_http_main.cc 388 initialization of 'all_tests' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h 29 initialization of 'kAttributesLimitOverflowKey' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h 31 initialization of 'kOverflowAttributes' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/src/metrics/instrument_metadata_validator.cc 23 initialization of 'kInstrumentNamePattern' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/src/metrics/instrument_metadata_validator.cc 25 initialization of 'kInstrumentUnitPattern' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/src/trace/tracer.cc 40 initialization of 'kNoopTracer' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/common/circular_buffer_test.cc 26 initialization of 'RandomNumberGenerator' with thread_local storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 57 initialization of 'attr1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 59 initialization of 'attr2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 61 initialization of 'attr3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 64 initialization of 'test_scope_1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 66 initialization of 'test_scope_2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 68 initialization of 'test_scope_3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 73 initialization of 'test_scope_4' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_config_test.cc 78 initialization of 'test_scope_5' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 776 initialization of 'schema' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 780 initialization of 'instrumentation_scope_1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 782 initialization of 'test_log_recordable_1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 784 initialization of 'expected_log_recordable_1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 786 initialization of 'custom_log_configurator_test_data_1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 792 initialization of 'instrumentation_scope_2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 793 initialization of 'test_log_recordable_2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 795 initialization of 'expected_log_recordable_2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 797 initialization of 'custom_log_configurator_test_data_2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 803 initialization of 'instrumentation_scope_3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 804 initialization of 'test_log_recordable_3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 806 initialization of 'expected_log_recordable_3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 808 initialization of 'custom_log_configurator_test_data_3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 814 initialization of 'instrumentation_scope_4' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 815 initialization of 'test_log_recordable_4' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 817 initialization of 'expected_log_recordable_4' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/logs/logger_sdk_test.cc 819 initialization of 'custom_log_configurator_test_data_4' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 39 initialization of 'attr1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 41 initialization of 'attr2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 43 initialization of 'attr3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 46 initialization of 'test_scope_1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 48 initialization of 'test_scope_2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 50 initialization of 'test_scope_3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 55 initialization of 'test_scope_4' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/meter_config_test.cc 60 initialization of 'test_scope_5' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/metrics/sync_instruments_test.cc 24 initialization of 'instrumentation_scope' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 39 initialization of 'attr1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 41 initialization of 'attr2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 43 initialization of 'attr3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 46 initialization of 'test_scope_1' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 48 initialization of 'test_scope_2' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 50 initialization of 'test_scope_3' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 55 initialization of 'test_scope_4' with static storage duration may throw an exception that cannot be caught
opentelemetry-cpp/sdk/test/trace/tracer_config_test.cc 60 initialization of 'test_scope_5' with static storage duration may throw an exception that cannot be caught

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions