Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plan move to C++17 #3121

Open
marcalff opened this issue Nov 4, 2024 · 1 comment
Open

Plan move to C++17 #3121

marcalff opened this issue Nov 4, 2024 · 1 comment
Labels
bug Something isn't working needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@marcalff
Copy link
Member

marcalff commented Nov 4, 2024

According to the Abseil doc:

support for C++14 will be revisited on 2024-12-15:

Per policies:

C++ 14 will be dropped for C++17:

We will drop support for our oldest supported C++ standard when one of the following happens:

    All supported compilers* default to a newer version
    When 10 years pass since the standard's release date
    Example: In 2023, if all supported compilers use C++17 as their default, then we can drop support for C++14. Otherwise, we'll need to wait until 2024, which would be 10 years after C++14 was released.

When abseil no longer supports C++14 and requires C++17, so will gtest, gmock, grpc, overall forcing opentelemetry-cpp to drop C++14 as well.

We need to plan for this

@marcalff marcalff added the bug Something isn't working label Nov 4, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 4, 2024
@sjinks
Copy link
Contributor

sjinks commented Nov 10, 2024

The code does use C++20 extensions (specifically, sdk/include/opentelemetry/sdk/common/global_log_handler.h does). You can confirm this by building with -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-Wc++20-extensions -Wc++20-compat-pedantic"

/home/volodymyr/github/opentelemetry-cpp/sdk/src/logs/logger_provider.cc:35:3: warning: passing no argument for the '...' parameter of a variadic macro is a C++20 extension [-Wc++20-extensions]
   35 |   OTEL_INTERNAL_LOG_DEBUG("[LoggerProvider] LoggerProvider created.");
      |   ^
/home/volodymyr/github/opentelemetry-cpp/sdk/include/opentelemetry/sdk/common/global_log_handler.h:207:40: note: expanded from macro 'OTEL_INTERNAL_LOG_DEBUG'
  207 | #  define OTEL_INTERNAL_LOG_DEBUG(...) OTEL_INTERNAL_LOG_DEBUG_MACRO(__VA_ARGS__)(__VA_ARGS__)
      |                                        ^
/home/volodymyr/github/opentelemetry-cpp/sdk/include/opentelemetry/sdk/common/global_log_handler.h:206:65: note: expanded from macro 'OTEL_INTERNAL_LOG_DEBUG_MACRO'
  206 |                                   OTEL_INTERNAL_LOG_DEBUG_1_ARGS)
      |                                                                 ^
/home/volodymyr/github/opentelemetry-cpp/sdk/include/opentelemetry/sdk/common/global_log_handler.h:165:9: note: macro 'OTEL_INTERNAL_LOG_GET_3RD_ARG' defined here
  165 | #define OTEL_INTERNAL_LOG_GET_3RD_ARG(arg1, arg2, arg3, ...) arg3

/home/volodymyr/github/opentelemetry-cpp/sdk/src/trace/tracer_provider.cc:90:5: warning: passing no argument for the '...' parameter of a variadic macro is a C++20 extension [-Wc++20-extensions]
   90 |     OTEL_INTERNAL_LOG_ERROR("[TracerProvider::GetTracer] Library name is null.");
      |     ^
/home/volodymyr/github/opentelemetry-cpp/sdk/include/opentelemetry/sdk/common/global_log_handler.h:177:40: note: expanded from macro 'OTEL_INTERNAL_LOG_ERROR'
  177 | #  define OTEL_INTERNAL_LOG_ERROR(...) OTEL_INTERNAL_LOG_ERROR_MACRO(__VA_ARGS__)(__VA_ARGS__)
      |                                        ^
/home/volodymyr/github/opentelemetry-cpp/sdk/include/opentelemetry/sdk/common/global_log_handler.h:176:65: note: expanded from macro 'OTEL_INTERNAL_LOG_ERROR_MACRO'
  176 |                                   OTEL_INTERNAL_LOG_ERROR_1_ARGS)
      |                                                                 ^
/home/volodymyr/github/opentelemetry-cpp/sdk/include/opentelemetry/sdk/common/global_log_handler.h:165:9: note: macro 'OTEL_INTERNAL_LOG_GET_3RD_ARG' defined here
  165 | #define OTEL_INTERNAL_LOG_GET_3RD_ARG(arg1, arg2, arg3, ...) arg3
      |         ^
...
/home/volodymyr/github/opentelemetry-cpp/sdk/test/metrics/base2_exponential_histogram_indexer_test.cc:149:27: warning: hexadecimal floating literals are a C++17 feature [-Wc++17-extensions]
  149 |   EXPECT_EQ(compute_index(0x1.FFFFFFFFFFFFFp1023), 63);

(I didn't build the entire library; there could be more compatibility issues)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants