-
Notifications
You must be signed in to change notification settings - Fork 440
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] Avoid buggy warning with gcc <= 8 #3087
[BUILD] Avoid buggy warning with gcc <= 8 #3087
Conversation
…" warning with gcc <= 8 gcc <= 8, when building with -Wextra (and -Werror) wrongly raises this: /data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/trace/18-0-0-7/include/opentelemetry/trace/default_span.h: In copy constructor 'opentelemetry::v1::trace::DefaultSpan::DefaultSpan(const opentelemetry::v1::trace::DefaultSpan&)': /data/mwrep/res/mdw/SIOTF/internal/opentelemetry_cpp/trace/18-0-0-7/include/opentelemetry/trace/default_span.h:70:3: error: base class 'class opentelemetry::v1::trace::Span' should be explicitly initialized in the copy constructor [-Werror=extra] DefaultSpan(const DefaultSpan &spn) noexcept : span_context_(spn.GetContext()) {} ^~~~~~~~~~~ See on Compiler Explorer here: https://godbolt.org/z/ed5rv74nT I believe Jason Merrill fixed it in gcc for all gcc >= 9 with: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=f3f7cefecc833b4ab652215ceb8b408c21dca225;hp=777083bb806dbe31ab97002b7d445191d3ee7a2d Workaround this by calling explicitly the empty Span constructor.
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3087 +/- ##
==========================================
+ Coverage 87.12% 87.82% +0.71%
==========================================
Files 200 195 -5
Lines 6109 5968 -141
==========================================
- Hits 5322 5241 -81
+ Misses 787 727 -60
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Generally, I am not in favor of providing fix for a buggy compiler, but in this case the fix is trivial, and no side effect so should be fine :)
Bonjour @Romain-Geissler-1A The links to compiler explorer and to the gcc patch makes this very convincing, thanks for the research. LGTM. |
gcc <= 8, when building with -Wextra (and -Werror) wrongly raises this:
See on Compiler Explorer here: https://godbolt.org/z/ed5rv74nT
I believe Jason Merrill fixed it in gcc for all gcc >= 9 with: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=f3f7cefecc833b4ab652215ceb8b408c21dca225;hp=777083bb806dbe31ab97002b7d445191d3ee7a2d
Workaround this by calling explicitly the empty Span constructor.