-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[RFC] Utilities/XrdAdaptor: fix -Wunused-result errors #13045
[RFC] Utilities/XrdAdaptor: fix -Wunused-result errors #13045
Conversation
A new Pull Request was created by @davidlt for CMSSW_8_0_X. It involves the following packages: Utilities/XrdAdaptor @cmsbuild, @smuzaffar, @Dr15Jones, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are list here #13028 |
@@ -83,7 +83,16 @@ class XrdStorageMaker final : public StorageMaker | |||
XrdCl::URL url(fullpath); | |||
XrdCl::FileSystem fs(url); | |||
std::vector<std::string> fileList; fileList.push_back(url.GetPath()); | |||
fs.Prepare(fileList, XrdCl::PrepareFlags::Stage, 0, &m_null_handler); | |||
XrdCl::XRootDStatus status; | |||
status = fs.Prepare(fileList, XrdCl::PrepareFlags::Stage, 0, &m_null_handler); |
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.
auto status = ...
would be more concise.
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.
I just followed patterns and style in this package :)
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.
auto
is better... no time like the current to improve things!
Thanks for the patch! For what it's worth, I asked Xrootd upstream to add So, this is definitely A Good Thing to do. |
Some xrootd methods are marked with `XRD_WARN_UNUSED_RESULT` (`__attribute__((warn_unused_result))`) and `-Wunused-result` forces us to not ignore return values. src/Utilities/XrdAdaptor/src/XrdSource.cc:327:9: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] src/Utilities/XrdAdaptor/src/XrdSource.cc:338:9: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] src/Utilities/XrdAdaptor/src/XrdRequestManager.cc:102:9: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] src/Utilities/XrdAdaptor/plugins/XrdStorageMaker.cc:86:5: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
f8f1b6e
to
7134e88
Compare
Pull request #13045 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @davidlange6 can you please check and sign again. |
Done, |
Looks good to me. |
please test |
+1 |
The tests are being triggered in jenkins. |
This pull request is fully signed and it will be integrated in one of the next CMSSW_8_0_X IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @Degano, @smuzaffar |
Once this gets in, we can move to Clang 3.7.1 in stable and 3.8.0 RC1 in next branch. |
-1 Tested at: 7134e88 cmsDriver.py RelVal -s L1REPACK:GT2 --data --scenario=HeavyIons -n 10 --conditions auto:run2_hlt_HIon --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_HI --magField 38T_PostLS1 --fileout file:RelVal_Raw_HIon_DATA.root --filein /store/hidata/HIRun2015/HIHardProbes/RAW-RECO/HighPtJet-PromptReco-v1/000/263/689/00000/1802CD9A-DDB8-E511-9CF9-02163E0138CA.root : FAILED - time: date Wed Jan 27 00:25:16 2016-date Wed Jan 27 00:24:33 2016 s - exit: 23552 you can see the results of the tests here: The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
[RFC] Utilities/XrdAdaptor: fix -Wunused-result errors
IB failures appear to be unrelated ("File not found" at EOS; tried opening from MIT but lacked appropriate credentials). |
Files were deleted from sites, I already made several transfer requests. |
Some xrootd methods are marked with
XRD_WARN_UNUSED_RESULT
(
__attribute__((warn_unused_result))
) and-Wunused-result
forces usto not ignore return values.
Feel free to take it and modify as needed as I might not have picked a correct way of handling issues (warnings/error/exception/cleanups before exception/etc).
Signed-off-by: David Abdurachmanov David.Abdurachmanov@cern.ch