Skip to content

Commit bef0b90

Browse files
authored
[CODE HEALTH] Fix clang-tidy macro to enum warnings (open-telemetry#3922)
1 parent 739862d commit bef0b90

File tree

6 files changed

+8
-21
lines changed

6 files changed

+8
-21
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Increment the:
4242
* [CODE HEALTH] Fix clang-tidy misc-use-internal-linkage warnings
4343
[#3600](https://github.com/open-telemetry/opentelemetry-cpp/pull/3600)
4444

45+
* [CODE HEALTH] Fix clang-tidy macro to enum warnings
46+
[#3922](https://github.com/open-telemetry/opentelemetry-cpp/pull/3922)
47+
4548
Important changes:
4649

4750
* [BUILD] Revisit EventLogger deprecation

api/include/opentelemetry/common/macros.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,10 @@
246246

247247
// Regex support
248248
#if (__GNUC__ == 4 && (__GNUC_MINOR__ == 8 || __GNUC_MINOR__ == 9))
249+
// NOLINTNEXTLINE(cppcoreguidelines-macro-to-enum)
249250
# define OPENTELEMETRY_HAVE_WORKING_REGEX 0
250251
#else
252+
// NOLINTNEXTLINE(cppcoreguidelines-macro-to-enum)
251253
# define OPENTELEMETRY_HAVE_WORKING_REGEX 1
252254
#endif
253255

api/include/opentelemetry/version.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
#include "opentelemetry/detail/preprocessor.h"
88

99
#ifndef OPENTELEMETRY_ABI_VERSION_NO
10+
// NOLINTNEXTLINE(cppcoreguidelines-macro-to-enum)
1011
# define OPENTELEMETRY_ABI_VERSION_NO 1
1112
#endif
1213

14+
// NOLINTBEGIN(cppcoreguidelines-macro-to-enum)
1315
#define OPENTELEMETRY_VERSION "1.26.0-dev"
1416
#define OPENTELEMETRY_VERSION_MAJOR 1
1517
#define OPENTELEMETRY_VERSION_MINOR 26
1618
#define OPENTELEMETRY_VERSION_PATCH 0
19+
// NOLINTEND(cppcoreguidelines-macro-to-enum)
1720

1821
#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)
1922

sdk/include/opentelemetry/sdk/logs/event_logger_provider.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
#include "opentelemetry/version.h"
1515

16-
// Define the maximum number of loggers that are allowed to be registered to the loggerprovider.
17-
// TODO: Add link to logging spec once this is added to it
18-
#define MAX_LOGGER_COUNT 100
19-
2016
OPENTELEMETRY_BEGIN_NAMESPACE
2117
namespace sdk
2218
{

sdk/include/opentelemetry/sdk/logs/logger_provider.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
#include "opentelemetry/sdk/resource/resource.h"
2020
#include "opentelemetry/version.h"
2121

22-
// Define the maximum number of loggers that are allowed to be registered to the loggerprovider.
23-
// TODO: Add link to logging spec once this is added to it
24-
#define MAX_LOGGER_COUNT 100
25-
2622
OPENTELEMETRY_BEGIN_NAMESPACE
2723
namespace sdk
2824
{

sdk/src/logs/logger_provider.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,6 @@ opentelemetry::nostd::shared_ptr<opentelemetry::logs::Logger> LoggerProvider::Ge
9696
}
9797
}
9898

99-
// Check if creating a new logger would exceed the max number of loggers
100-
// TODO: Remove the noexcept from the API's and SDK's GetLogger(~)
101-
/*
102-
if (loggers_.size() > MAX_LOGGER_COUNT)
103-
{
104-
#if __EXCEPTIONS
105-
throw std::length_error("Number of loggers exceeds max count");
106-
#else
107-
std::terminate();
108-
#endif
109-
}
110-
*/
111-
11299
std::unique_ptr<instrumentationscope::InstrumentationScope> lib =
113100
instrumentationscope::InstrumentationScope::Create(library_name, library_version, schema_url,
114101
attributes);

0 commit comments

Comments
 (0)