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

[ALCA] Fix copy-constructor warnings reported in DEVEL IBs #43423

Conversation

aandvalenzuela
Copy link
Contributor

Hello,

This PR follows up on the discussion started at #43408.
I am defining the missing assignment operators to fulfill the rule of three (see #43408 (comment)) to avoid missing initializations (see #43408 (comment))

Thanks!

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43423/37938

  • This PR adds an extra 12KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@@ -29,6 +29,9 @@ class SiStripHashedDetId {
/** Copy constructor. */
SiStripHashedDetId(const SiStripHashedDetId &);

/** Assignment operator. */
const SiStripHashedDetId &operator=(const SiStripHashedDetId &) { return *this; }
Copy link
Contributor

Choose a reason for hiding this comment

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

@aandvalenzuela are you sure this is correct?

Copy link
Contributor Author

@aandvalenzuela aandvalenzuela Nov 28, 2023

Choose a reason for hiding this comment

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

No, I am not. This is what the code format reported (see https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43423/37938/code-format.patch). I was actually taking this issue offline... any idea why the code formatting is reporting on code that has not been touched?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean - are you sure you have implemented operator= correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that is the default implementation, but I am not familiar with it. Do you have any suggestions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does something like this look better?

TSinglePedEntry& operator=(const TSinglePedEntry& orig) {
    m_pedestalSqSum = orig.m_pedestalSqSum;
    m_pedestalSum = orig.m_pedestalSum;
    m_entries = orig.m_entries;
    return *this; 
 }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmm...

TSinglePedEntry& operator=(const TSinglePedEntry& orig) = default;

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43423/37940

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @aandvalenzuela (Andrea Valenzuela) for master.

It involves the following packages:

  • CalibCalorimetry/EcalPedestalOffsets (alca)
  • CalibFormats/SiStripObjects (alca)

@consuegs, @cmsbuild, @saumyaphor4252, @perrotta can you please review it and eventually sign? Thanks.
@rsreds, @threus, @rchatter, @wang0jin, @yuanchao, @argiro, @tocheng, @mmusich, @ReyerBand, @thomreis this is something you requested to watch as well.
@antoniovilela, @sextonkennedy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43423/37941

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

Pull request #43423 was updated. @perrotta, @cmsbuild, @consuegs, @saumyaphor4252 can you please check and sign again.

Apply code format

Apply code format

Use default implementation
@aandvalenzuela aandvalenzuela force-pushed the alca-from-CMSSW_14_0_DEVEL_X_2023-11-27-2300 branch from f4b0135 to 70f2763 Compare November 28, 2023 17:50
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43423/37943

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

Pull request #43423 was updated. @perrotta, @consuegs, @saumyaphor4252, @cmsbuild can you please check and sign again.

@aandvalenzuela
Copy link
Contributor Author

please test

@aandvalenzuela
Copy link
Contributor Author

please test for CMSSW_14_0_DEVEL_X

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-48da4d/36134/summary.html
COMMIT: 70f2763
CMSSW: CMSSW_14_0_X_2023-11-28-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/43423/36134/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 63 lines to the logs
  • Reco comparison results: 3 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3367918
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3367895
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 214 log files, 167 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-48da4d/36136/summary.html
COMMIT: 70f2763
CMSSW: CMSSW_14_0_DEVEL_X_2023-11-27-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/43423/36136/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@perrotta
Copy link
Contributor

+alca

  • Default assignment operators added

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @rappoccio, @sextonkennedy, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2)

@rappoccio
Copy link
Contributor

+1

@@ -29,6 +29,9 @@ class SiStripHashedDetId {
/** Copy constructor. */
SiStripHashedDetId(const SiStripHashedDetId &);

/** Assignment operator. */
SiStripHashedDetId &operator=(const SiStripHashedDetId &) = default;
Copy link
Contributor

Choose a reason for hiding this comment

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

@aandvalenzuela @perrotta
unfortunately this leads to wrong intializations of the assigned object. I fixed this at 3eda318 (incidentally also the copy constructor right above was buggy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants