open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
817 stars 392 forks source link

Compile errors occur when using gcc 14 #2591

Closed kpvdr closed 1 month ago

kpvdr commented 3 months ago

When building opentelemetry-cpp 1.14.2 for Fedora using gcc-c++ 14.0.1 (which is the default for upcoming Fedora 40 and rawhide), compile errors occur. Builds for the current Fedora 38 and 39 which use gcc-c++ 13.2.1 succeed.

The errors appear to concern templates and their argument lists. The builds may be seen on Copr[1] with the build logs and environments. All the failed builds are using gcc 14.0.1. When I built 1.13.0 a few months back, Fedora 40 and rawhide were still using gcc 1.13.2, and they were successful. All the build failures for Fedora 40 and rawhide appear to be identical.

Because Copr deletes the build logs for failed builds after a few days, I have attached the log for the x86_64 rawhide build. builder-live.log.gz

[1] https://copr.fedorainfracloud.org/coprs/kpvdr/opentelemetry-cpp/build/7153160/

owent commented 3 months ago

GCC 14 is not released yet. I will test and fix all the compatibility problem after GCC 14 is released.

kpvdr commented 2 months ago

It appears that 14 is not yet officially released on gnu.org. However, Fedora 40 has been released and uses gcc 14.0.1.

kpvdr commented 1 month ago

gcc 14.1 was relesaed on May 7. (https://gcc.gnu.org/gcc-14)

owent commented 1 month ago

Thanks, I will test it several days later.

marcalff commented 1 month ago

Can not reproduce.

The opentelemetry-cpp CI was upgraded to use gcc-14, and it passes without code changes:

Please reopen with details if this is still an issue.

owent commented 4 weeks ago

I built otel-cpp v1.15.0 with GCC 14 successfully without any modification. But I found other problems with GCC 14 when building other packages. I solved the compiling problems by add -Wno-error=incompatible-pointer-types and -Wno-error=implicit-int to CFLAGS and CXXFLAGS. Hope helpful for your situation.

kpvdr commented 1 week ago

This issue appears to occur when the internal abseil code is used. A cmake build which does not set WITH_ABSEIL or setting WITH_ABSEIL=OFF will cause the internal abseil code to be used. Building with this configuration using GCC14 appears to trigger the issue.

kpvdr commented 1 week ago

This issue is still present on 1.16.0.