Skip to content

Commit 7e1e9ca

Browse files
committed
Merge remote-tracking branch 'remotes/origin/main' into cppcheck
2 parents 9305c6c + a5db7e5 commit 7e1e9ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1262
-558
lines changed

.github/workflows/cppcheck.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
cppcheck:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
@@ -18,26 +18,11 @@ jobs:
1818
- name: Set up dependencies
1919
run: |
2020
sudo apt update -y
21-
sudo apt install -y --no-install-recommends --no-install-suggests \
22-
build-essential \
23-
cppcheck \
24-
cmake \
25-
ninja-build \
26-
libssl-dev \
27-
libcurl4-openssl-dev \
28-
libprotobuf-dev \
29-
protobuf-compiler \
30-
libgmock-dev \
31-
libgtest-dev \
32-
libbenchmark-dev
33-
34-
- name: Prepare CMake
35-
run: |
36-
mkdir build && cd build
37-
CC="clang" CXX="clang++" cmake ..
21+
sudo apt install -y cppcheck
3822
3923
- name: Run cppcheck
4024
run: |
25+
cppcheck --version | tee cppcheck.log
4126
cppcheck \
4227
--force \
4328
--enable=warning,performance,portability \
@@ -60,7 +45,7 @@ jobs:
6045
-i test \
6146
-i third_party \
6247
-j $(nproc) \
63-
. 2>&1 | tee cppcheck.log
48+
. 2>&1 | tee --append cppcheck.log
6449
6550
- uses: actions/upload-artifact@v4
6651
if: success() || failure()
@@ -73,4 +58,5 @@ jobs:
7358
set +e
7459
COUNT=`grep -c -E "\[.+\]" cppcheck.log`
7560
echo "cppcheck reported ${COUNT} warning(s)"
76-
if [ $COUNT -ne 0 ] ; then exit 1 ; fi
61+
# TODO: uncomment to enforce failing the build
62+
# if [ $COUNT -ne 0 ] ; then exit 1 ; fi

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Increment the:
2727
* [SEMANTIC CONVENTIONS] Migration to weaver
2828
[#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)
2929

30+
* [EXPORTER] Allow to share gRPC clients between OTLP exporters.
31+
[#3041](https://github.com/open-telemetry/opentelemetry-cpp/pull/3041)
32+
3033
Important changes:
3134

3235
* [API] Jaeger Propagator should not be deprecated

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,8 @@ if(WITH_OTLP_GRPC
389389
OR WITH_OTLP_HTTP
390390
OR WITH_OTLP_FILE)
391391
find_package(Protobuf)
392-
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
393-
if(NOT WITH_ABSEIL)
394-
message(
395-
FATAL_ERROR
396-
"Protobuf 3.22 or upper require abseil-cpp(Recommended version: 20230125 or upper)"
397-
)
398-
endif()
399-
endif()
392+
# Protobuf 3.22 or upper require abseil-cpp, we can find it in
393+
# opentelemetry-cpp-config.cmake
400394

401395
if(WITH_OTLP_GRPC)
402396
find_package(gRPC)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Notes on Abseil Variant implementation
22

3-
This is a snapshot of Abseil Variant `absl::variant` from Abseil
4-
`v2020-03-03#8`.
3+
This is a snapshot of Abseil Variant
4+
`absl::OTABSL_OPTION_NAMESPACE_NAME::variant` from Abseil `v2020-03-03#8`.

api/include/opentelemetry/nostd/internal/absl/base/config.h

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
// namespace absl {
8585
// OTABSL_NAMESPACE_BEGIN
8686
//
87-
// void Foo(); // absl::Foo().
87+
// void Foo(); // absl::OTABSL_OPTION_NAMESPACE_NAME::Foo().
8888
//
8989
// OTABSL_NAMESPACE_END
9090
// } // namespace absl
@@ -94,40 +94,32 @@
9494
// not support forward declarations of its own types, nor does it support
9595
// user-provided specialization of Abseil templates. Code that violates these
9696
// rules may be broken without warning.)
97-
#if !defined(OTABSL_OPTION_USE_INLINE_NAMESPACE) || \
98-
!defined(OTABSL_OPTION_INLINE_NAMESPACE_NAME)
97+
#if !defined(OTABSL_OPTION_NAMESPACE_NAME)
9998
#error options.h is misconfigured.
10099
#endif
101100

102-
// Check that OTABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor ""
103-
#if defined(__cplusplus) && OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
101+
// Check that OTABSL_OPTION_NAMESPACE_NAME is neither "head" nor ""
102+
#if defined(__cplusplus)
104103

105104
#define OTABSL_INTERNAL_INLINE_NAMESPACE_STR \
106-
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_INLINE_NAMESPACE_NAME)
105+
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_NAMESPACE_NAME)
107106

108107
static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != '\0',
109-
"options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
108+
"options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
110109
"not be empty.");
111110
static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
112111
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[1] != 'e' ||
113112
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[2] != 'a' ||
114113
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[3] != 'd' ||
115114
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[4] != '\0',
116-
"options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
115+
"options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
117116
"be changed to a new, unique identifier name.");
118117

119118
#endif
120119

121-
#if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
122-
#define OTABSL_NAMESPACE_BEGIN
123-
#define OTABSL_NAMESPACE_END
124-
#elif OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
125-
#define OTABSL_NAMESPACE_BEGIN \
126-
inline namespace OTABSL_OPTION_INLINE_NAMESPACE_NAME {
120+
121+
#define OTABSL_NAMESPACE_BEGIN namespace OTABSL_OPTION_NAMESPACE_NAME {
127122
#define OTABSL_NAMESPACE_END }
128-
#else
129-
#error options.h is misconfigured.
130-
#endif
131123

132124
// -----------------------------------------------------------------------------
133125
// Compiler Feature Checks
@@ -217,7 +209,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
217209

218210
// OTABSL_HAVE_SOURCE_LOCATION_CURRENT
219211
//
220-
// Indicates whether `absl::SourceLocation::current()` will return useful
212+
// Indicates whether `absl::OTABSL_OPTION_NAMESPACE_NAME::SourceLocation::current()` will return useful
221213
// information in some contexts.
222214
#ifndef OTABSL_HAVE_SOURCE_LOCATION_CURRENT
223215
#if OTABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \
@@ -570,7 +562,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
570562

571563
// OTABSL_USES_STD_ANY
572564
//
573-
// Indicates whether absl::any is an alias for std::any.
565+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::any is an alias for std::any.
574566
#if !defined(OTABSL_OPTION_USE_STD_ANY)
575567
#error options.h is misconfigured.
576568
#elif OTABSL_OPTION_USE_STD_ANY == 0 || \
@@ -585,7 +577,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
585577

586578
// OTABSL_USES_STD_OPTIONAL
587579
//
588-
// Indicates whether absl::optional is an alias for std::optional.
580+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::optional is an alias for std::optional.
589581
#if !defined(OTABSL_OPTION_USE_STD_OPTIONAL)
590582
#error options.h is misconfigured.
591583
#elif OTABSL_OPTION_USE_STD_OPTIONAL == 0 || \
@@ -600,7 +592,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
600592

601593
// OTABSL_USES_STD_VARIANT
602594
//
603-
// Indicates whether absl::variant is an alias for std::variant.
595+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::variant is an alias for std::variant.
604596
#if !defined(OTABSL_OPTION_USE_STD_VARIANT)
605597
#error options.h is misconfigured.
606598
#elif OTABSL_OPTION_USE_STD_VARIANT == 0 || \
@@ -615,7 +607,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
615607

616608
// OTABSL_USES_STD_STRING_VIEW
617609
//
618-
// Indicates whether absl::string_view is an alias for std::string_view.
610+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::string_view is an alias for std::string_view.
619611
#if !defined(OTABSL_OPTION_USE_STD_STRING_VIEW)
620612
#error options.h is misconfigured.
621613
#elif OTABSL_OPTION_USE_STD_STRING_VIEW == 0 || \
@@ -650,15 +642,10 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
650642
// the proper count to skip past the CCTZ fork namespace names. (This number
651643
// is one larger when there is an inline namespace name to skip.)
652644
#if defined(_MSC_VER)
653-
#if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
654-
#define OTABSL_INTERNAL_MANGLED_NS "absl"
655-
#define OTABSL_INTERNAL_MANGLED_BACKREFERENCE "5"
656-
#else
657645
#define OTABSL_INTERNAL_MANGLED_NS \
658-
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_INLINE_NAMESPACE_NAME) "@absl"
646+
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_NAMESPACE_NAME) "@absl"
659647
#define OTABSL_INTERNAL_MANGLED_BACKREFERENCE "6"
660648
#endif
661-
#endif
662649

663650
#undef OTABSL_INTERNAL_HAS_KEYWORD
664651

api/include/opentelemetry/nostd/internal/absl/base/internal/inline_variable.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@
6868
// types, etc..
6969
#if defined(__clang__)
7070
#define OTABSL_INTERNAL_EXTERN_DECL(type, name) \
71-
extern const ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<type> name;
71+
extern const ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<type> name;
7272
#else // Otherwise, just define the macro to do nothing.
7373
#define OTABSL_INTERNAL_EXTERN_DECL(type, name)
7474
#endif // defined(__clang__)
7575

7676
// See above comment at top of file for details.
7777
#define OTABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) \
7878
OTABSL_INTERNAL_EXTERN_DECL(type, name) \
79-
inline constexpr ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<type> name = init
79+
inline constexpr ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<type> name = init
8080

8181
#else
8282

@@ -89,14 +89,14 @@
8989
#define OTABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \
9090
template <class /*AbslInternalDummy*/ = void> \
9191
struct AbslInternalInlineVariableHolder##name { \
92-
static constexpr ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<var_type> kInstance = init; \
92+
static constexpr ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<var_type> kInstance = init; \
9393
}; \
9494
\
9595
template <class AbslInternalDummy> \
96-
constexpr ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<var_type> \
96+
constexpr ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<var_type> \
9797
AbslInternalInlineVariableHolder##name<AbslInternalDummy>::kInstance; \
9898
\
99-
static constexpr const ::absl::OTABSL_OPTION_INLINE_NAMESPACE_NAME::internal::identity_t<var_type>& \
99+
static constexpr const ::absl::OTABSL_OPTION_NAMESPACE_NAME::internal::identity_t<var_type>& \
100100
name = /* NOLINT */ \
101101
AbslInternalInlineVariableHolder##name<>::kInstance; \
102102
static_assert(sizeof(void (*)(decltype(name))) != 0, \

api/include/opentelemetry/nostd/internal/absl/base/internal/invoke.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
//
15-
// absl::base_internal::Invoke(f, args...) is an implementation of
15+
// absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal::Invoke(f, args...) is an implementation of
1616
// INVOKE(f, args...) from section [func.require] of the C++ standard.
1717
//
1818
// [func.require]
@@ -73,7 +73,7 @@ struct MemFunAndRef : StrippedAccept<MemFunAndRef> {
7373
template <typename MemFunType, typename C, typename Obj, typename... Args>
7474
struct AcceptImpl<MemFunType C::*, Obj, Args...>
7575
: std::integral_constant<bool, std::is_base_of<C, Obj>::value &&
76-
absl::is_function<MemFunType>::value> {
76+
absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<MemFunType>::value> {
7777
};
7878

7979
template <typename MemFun, typename Obj, typename... Args>
@@ -94,7 +94,7 @@ struct MemFunAndPtr : StrippedAccept<MemFunAndPtr> {
9494
template <typename MemFunType, typename C, typename Ptr, typename... Args>
9595
struct AcceptImpl<MemFunType C::*, Ptr, Args...>
9696
: std::integral_constant<bool, !std::is_base_of<C, Ptr>::value &&
97-
absl::is_function<MemFunType>::value> {
97+
absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<MemFunType>::value> {
9898
};
9999

100100
template <typename MemFun, typename Ptr, typename... Args>
@@ -116,7 +116,7 @@ struct DataMemAndRef : StrippedAccept<DataMemAndRef> {
116116
template <typename R, typename C, typename Obj>
117117
struct AcceptImpl<R C::*, Obj>
118118
: std::integral_constant<bool, std::is_base_of<C, Obj>::value &&
119-
!absl::is_function<R>::value> {};
119+
!absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<R>::value> {};
120120

121121
template <typename DataMem, typename Ref>
122122
static decltype(std::declval<Ref>().*std::declval<DataMem>()) Invoke(
@@ -134,7 +134,7 @@ struct DataMemAndPtr : StrippedAccept<DataMemAndPtr> {
134134
template <typename R, typename C, typename Ptr>
135135
struct AcceptImpl<R C::*, Ptr>
136136
: std::integral_constant<bool, !std::is_base_of<C, Ptr>::value &&
137-
!absl::is_function<R>::value> {};
137+
!absl::OTABSL_OPTION_NAMESPACE_NAME::is_function<R>::value> {};
138138

139139
template <typename DataMem, typename Ptr>
140140
static decltype((*std::declval<Ptr>()).*std::declval<DataMem>()) Invoke(

api/include/opentelemetry/nostd/internal/absl/base/macros.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// can be used in defining new arrays. If you use this macro on a pointer by
4242
// mistake, you will get a compile-time error.
4343
#define OTABSL_ARRAYSIZE(array) \
44-
(sizeof(::absl::macros_internal::ArraySizeHelper(array)))
44+
(sizeof(::absl::OTABSL_OPTION_NAMESPACE_NAME::macros_internal::ArraySizeHelper(array)))
4545

4646
namespace absl {
4747
OTABSL_NAMESPACE_BEGIN
@@ -60,7 +60,7 @@ OTABSL_NAMESPACE_END
6060
// static storage duration, and that the constructor should do nothing to its
6161
// state. Use of this macro indicates to the reader that it is legal to
6262
// declare a static instance of the class, provided the constructor is given
63-
// the absl::base_internal::kLinkerInitialized argument.
63+
// the absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal::kLinkerInitialized argument.
6464
//
6565
// Normally, it is unsafe to declare a static variable that has a constructor or
6666
// a destructor because invocation order is undefined. However, if the type can
@@ -70,10 +70,10 @@ OTABSL_NAMESPACE_END
7070
//
7171
// Example:
7272
// // Declaration
73-
// explicit MyClass(absl::base_internal:LinkerInitialized x) {}
73+
// explicit MyClass(absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal:LinkerInitialized x) {}
7474
//
7575
// // Invocation
76-
// static MyClass my_global(absl::base_internal::kLinkerInitialized);
76+
// static MyClass my_global(absl::OTABSL_OPTION_NAMESPACE_NAME::base_internal::kLinkerInitialized);
7777
namespace absl {
7878
OTABSL_NAMESPACE_BEGIN
7979
namespace base_internal {

0 commit comments

Comments
 (0)