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

[BUILD] Clang-15 warning about __has_trivial_destructor #2502

Merged
merged 7 commits into from
Jan 23, 2024

Conversation

marcalff
Copy link
Member

@marcalff marcalff commented Jan 22, 2024

Fixes #2321

Changes

Please provide a brief description of the changes here.

  • Upgrade gcc from 12 to 13 in CI maintainer mode builds
  • Upgrade clang from 14 to 15 in CI maintainer mode builds
  • Fixed a new warning [-Werror,-Wunused-but-set-variable] in spinlock_benchmark.cc
  • Backported the following fixes from abseil-cpp, to resolve clang-15 warnings.
commit cfe27e79cfcbefb2b4479e04f80cbb299bc46965
Author: Abseil Team <[email protected]>
Date:   Fri Aug 5 06:56:05 2022 -0700

    Map the absl::is_trivially_* functions to their std impl
    
    There's no point redefining these functions if they are supported by the compiler and the version of libstdc++. Also, some of the builtins used by the absl implementation of these functions (e.g. __has_trivial_destructor) have been deprecated in Clang 15.
    
    PiperOrigin-RevId: 465554125
    Change-Id: I8674c3a5270ce3c654cdf58ae7dbd9d2bda8faa5
commit e61fc6d8da5154c6a665d7a28b9978f11b78eb62
Author: Keith Smiley <[email protected]>
Date:   Tue Oct 4 17:22:04 2022 +0000

    Fix more clang deprecated builtins
    
    If you compile with clang 15+, the uses of trivially destructible and
    assignable are deprecated. This sets this configuration correctly as the
    ifdef to fix the build.
    
    Fixes https://github.com/abseil/abseil-cpp/issues/1201
    Related https://github.com/abseil/abseil-cpp/pull/1277

Note that the fixes are not applied as is: ABSL_HAVE_STD_IS_XXX is also renamed to OTABSL_HAVE_STD_IS_XXX

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

Copy link

codecov bot commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fe15d0a) 87.09% compared to head (aec05e5) 87.09%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2502   +/-   ##
=======================================
  Coverage   87.09%   87.09%           
=======================================
  Files         200      200           
  Lines        6103     6103           
=======================================
  Hits         5315     5315           
  Misses        788      788           

@marcalff
Copy link
Member Author

Note that upgrading from Clang 14 to Clang 15 in maintainer mode exposed the issue reported in #2321.

@marcalff marcalff changed the title [CI] Upgrade compiler in maintainer mode [BUILD] Clang-15 warning about __has_trivial_destructor Jan 22, 2024
@marcalff marcalff marked this pull request as ready for review January 23, 2024 01:28
@marcalff marcalff requested a review from a team January 23, 2024 01:28
@lalitb lalitb merged commit 8da71b7 into open-telemetry:main Jan 23, 2024
48 checks passed
@marcalff marcalff deleted the fix_maintainer_build branch June 3, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUILD] Clang-15 warning about __has_trivial_destructor
4 participants