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

Fix compilation warnings on LUMI with cce/17 #141

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

wdeconinck
Copy link
Member

This fixes a few warnings when compiling eckit on LUMI with CrayClang compiler cce/17.
One warning was for unrecognised flag for CrayClang as opposed to "just" Cray.
Another related to deprecated implicit assignment operator.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.70%. Comparing base (0c7680a) to head (bb478ce).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #141   +/-   ##
========================================
  Coverage    63.69%   63.70%           
========================================
  Files         1065     1065           
  Lines        55140    55142    +2     
  Branches      4085     4085           
========================================
+ Hits         35122    35126    +4     
+ Misses       20018    20016    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change adds move semantics, ctor and assignment.
previously, it was only copy
which is unusual for a class with a shared_ptr member

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which point(s) are you referring to that are unusual with shared_ptr member?

  1. copy constructor
  2. assignment operator
  3. move constructor
  4. move-assignment operator

And why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using move semantics (3 and 4) on a class with a member of shared_ptr type looks unusual to me

usual use of shared_ptr type objects is to copy it around, which increments count; not move it around

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, it is a big change of how this class works.
I like (and also prefer) the explicit definitions. it tells others it's intentional and clear.
I suggest, move ctor and assignment = delete;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will remove it. I just added it for completeness as the rule-of-five.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking it with =delete does not work and causes further errors. So I suggest leaving it with =default marks that this is the intended and supported behaviour.

@wdeconinck
Copy link
Member Author

wdeconinck commented Oct 2, 2024

This PR has now gone through all the relevant tests successfully.

Copy link
Contributor

@mcakircali mcakircali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved as it silences warnings
moved-from obj leaks pointer and shall be fixed in another PR

@wdeconinck wdeconinck merged commit 19e0ec8 into develop Oct 7, 2024
229 of 230 checks passed
@wdeconinck wdeconinck deleted the bugfix/fix_warnings branch October 7, 2024 14:37
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.

3 participants