Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Checks: >
-modernize-use-nodiscard,
-modernize-use-scoped-lock,
-modernize-use-trailing-return-type,
-modernize-deprecated-headers,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-use-equals-default,
Expand Down
4 changes: 2 additions & 2 deletions .iwyu.imp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },
{ "include": ["<bits/std_abs.h>", "private", "<cstdlib>", "public"] },
{ "include": ["<ext/alloc_traits.h>", "private", "<memory>", "public"] },
{ "include": ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
{ "include": ["<bits/types/struct_FILE.h>", "private", "<stdio.h>", "public"] },
{ "include": ["<bits/types/struct_tm.h>", "private", "<ctime>", "public"] },
{ "include": ["<bits/types/struct_FILE.h>", "private", "<cstdio>", "public"] },

# Work around for ryml
{ "include": ["<c4/std/string.hpp>", "private", "<ryml_std.hpp>", "public"] },
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Increment the:

## [Unreleased]

* [CODE HEALTH] Enable clang-tidy `modernize-deprecated-headers` and replace
deprecated C headers (`stdint.h`, `stddef.h`, `stdlib.h`, `string.h`,
`stdio.h`, `ctype.h`, `limits.h`, `assert.h`) with their C++ equivalents
([#4349](https://github.com/open-telemetry/opentelemetry-cpp/pull/4349))
* [CODE HEALTH] Move remaining `misc-use-internal-linkage` classes/enums into
anonymous namespaces: `OtlpFileSystemBackend`/`OtlpFileOstreamBackend` in
the OTLP file exporter, `ResponseHandler`/`AsyncResponseHandler`/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <stddef.h>
#include <cstddef>
#include <initializer_list>
#include <iterator>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/common/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <ctype.h>
#include <cctype>

#include "opentelemetry/common/macros.h"

Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/context/runtime_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#pragma once

#include <stddef.h>
#include <algorithm>
#include <cstddef>

#include "opentelemetry/common/macros.h"
#include "opentelemetry/context/context.h"
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <stdint.h>
#include <cstdint>
#include <type_traits>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/trace/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// This file is part of the internal implementation of OpenTelemetry. Nothing in this file should be
// used directly. Please refer to span.h and tracer.h for documentation on these interfaces.

#include <stdint.h>
#include <cstdint>
#include <utility>

#include "opentelemetry/common/attribute_value.h"
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/trace/span_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <stdint.h>
#include <cstdint>

#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/trace/trace_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <ctype.h>
#include <cctype>
#include <cstddef>
#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion api/test/baggage/baggage_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <benchmark/benchmark.h>
#include <stddef.h>
#include <cstddef>
#include <string>

#include "opentelemetry/baggage/baggage.h"
Expand Down
4 changes: 2 additions & 2 deletions api/test/baggage/baggage_test.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <assert.h>
#include <gtest/gtest.h>
#include <stddef.h>
#include <cassert>
#include <cstddef>
#include <string>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion api/test/common/kv_properties_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stddef.h>
#include <cstddef>
#include <string>
#include <utility>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion api/test/common/string_util_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <string.h>
#include <cstring>
#include <string>

#include <opentelemetry/common/string_util.h>
Expand Down
2 changes: 1 addition & 1 deletion api/test/context/context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <map>
#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions api/test/context/propagation/environment_carrier_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <stdlib.h>
#include <cstdint>
#include <cstdlib>
#include <map>
#include <string>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions api/test/context/runtime_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion api/test/core/timestamp_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdlib.h>
#include <chrono>
#include <cstdlib>
#include <string>
Expand Down
4 changes: 2 additions & 2 deletions api/test/core/version_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
#include <string>

#include "opentelemetry/version.h"
Expand Down
2 changes: 1 addition & 1 deletion api/test/logs/logger_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

#include <benchmark/benchmark.h>
#include <stdint.h>
#include <condition_variable>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <mutex>
#include <thread>
Expand Down
4 changes: 2 additions & 2 deletions api/test/logs/logger_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion api/test/metrics/noop_sync_instrument_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion api/test/nostd/shared_ptr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stddef.h>
#include <algorithm>
#include <cstddef>
#include <string>
#include <utility>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion api/test/nostd/span_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stddef.h>
#include <algorithm>
#include <array>
#include <cstddef>
#include <iterator>
#include <list>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion api/test/singleton/singleton_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h> // IWYU pragma: keep
#include <cstdint> // IWYU pragma: keep
#include <string>

#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <gtest/gtest.h>

#include <stdint.h>
#include <cstdint>
#include <string>

#include "opentelemetry/context/context.h"
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/noop_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <initializer_list>
#include <map>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/propagation/b3_propagation_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/propagation/detail/hex_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <string>

#include "opentelemetry/trace/propagation/detail/hex.h"
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/propagation/detail/string_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stddef.h>
#include <cstddef>
#include <ostream>
#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/propagation/http_text_format_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/propagation/jaeger_propagation_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/trace_flags_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stdint.h>
#include <cstdint>
#include <string>

#include "opentelemetry/nostd/span.h"
Expand Down
2 changes: 1 addition & 1 deletion api/test/trace/trace_state_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stddef.h>
#include <cstddef>
#include <string>

#include "opentelemetry/nostd/function_ref.h"
Expand Down
4 changes: 2 additions & 2 deletions examples/batch/main.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <stdint.h>
#include <stdio.h>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <string>
#include <thread>
Expand Down
4 changes: 2 additions & 2 deletions examples/common/metrics_foo_library/foo_library.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <stdint.h>
#include <stdlib.h>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <map>
#include <random>
#include <thread>
Expand Down
6 changes: 3 additions & 3 deletions examples/configuration/main.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>

#include "opentelemetry/exporters/ostream/console_log_record_builder.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <grpcpp/security/credentials.h>
#include <grpcpp/support/status.h>

#include <stdint.h>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <grpcpp/server_context.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/string_ref.h>
#include <stdint.h>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion examples/http/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "opentelemetry/trace/tracer.h"
#include "tracer_common.h"

#include <stdint.h>
#include <cstdint>
#include <cstdlib>
#include <map>
#include <string>
Expand Down
Loading
Loading