Property - Default initialise temporary to avoid GCC7 warnings.
When building the LHCb stack using GCC7, and I seeing warnings like
[1493/1506] Building CXX object Rich/RichFutureDAQ/CMakeFiles/RichFutureDAQ.dir/src/RichRawBankDecoder.cpp.o
In file included from /usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/TypeNameString.h:3:0,
from /usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/ISvcManager.h:7,
from /usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/ISvcLocator.h:6,
from /usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/Algorithm.h:11,
from /usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiAlg/GaudiAlgorithm.h:11,
from ../Rich/RichFutureKernel/RichFutureKernel/RichAlgBase.h:15,
from /var/clus/usera/jonesc/LHCbCMake/Master/LHCb/Rich/RichFutureDAQ/src/RichRawBankDecoder.h:16,
from /var/clus/usera/jonesc/LHCbCMake/Master/LHCb/Rich/RichFutureDAQ/src/RichRawBankDecoder.cpp:3:
/usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/Property.h: In member function ‘StatusCode Gaudi::Property<TYPE, VERIFIER, HANDLERS>::fromString(const string&) [with TYPE = std::array<bool, 2>; VERIFIER = Gaudi::Details::Property::NullVerifier; HANDLERS = Gaudi::Details::Property::UpdateHandler]’:
/usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/Property.h:468:7: warning: ‘*((void*)& tmp +1)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
m_value = std::forward<T>( v );
^~~~~~~
/usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/Property.h:162:16: note: ‘*((void*)& tmp +1)’ was declared here
TYPE tmp;
^~~
/usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/Property.h:468:7: warning: ‘tmp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
m_value = std::forward<T>( v );
^~~~~~~
/usera/jonesc/LHCbCMake/Master/Gaudi/InstallArea/x86_64-centos7-gcc7-opt/include/GaudiKernel/Property.h:162:16: note: ‘tmp’ was declared here
TYPE tmp;
^~~
The issue is the method toString
creates a temporary which could (or GCC7 things it could) be used uninitialised. This MR simply adds a default initializer to the temporary.
Merge request reports
Activity
- [2017-08-21 12:57] Validation started with lhcb-gaudi-merge#193
- [2017-08-22 00:03] Validation started with lhcb-future#509
- [2017-08-22 00:04] Validation started with lhcb-future-clang#289
- [2017-08-23 00:02] Validation started with lhcb-future-clang#290
- [2017-08-23 00:03] Validation started with lhcb-future#510
- [2017-08-24 00:03] Validation started with lhcb-future#511
- [2017-08-24 00:04] Validation started with lhcb-future-clang#291
- [2017-08-25 00:04] Validation started with lhcb-future#512
- [2017-08-25 00:04] Validation started with lhcb-future-clang#292
- [2017-08-26 00:03] Validation started with lhcb-future-clang#293
- [2017-08-26 00:04] Validation started with lhcb-future#513
- [2017-08-27 00:03] Validation started with lhcb-future-clang#294
- [2017-08-27 00:03] Validation started with lhcb-future#514
- [2017-08-28 00:03] Validation started with lhcb-future#515
- [2017-08-28 00:04] Validation started with lhcb-future-clang#295
- [2017-08-29 00:03] Validation started with lhcb-future#516
- [2017-08-30 00:04] Validation started with lhcb-future-clang#297
- [2017-08-30 00:04] Validation started with lhcb-future#517
- [2017-08-30 09:40] Validation started with lhcb-future#518
- [2017-08-31 00:03] Validation started with lhcb-future#519
- [2017-08-31 00:03] Validation started with lhcb-future-clang#298
- [2017-09-01 00:03] Validation started with lhcb-future-clang#299
- [2017-09-01 00:04] Validation started with lhcb-future#520
- [2017-09-01 08:49] Validation started with lhcb-future#521
- [2017-09-02 00:03] Validation started with lhcb-future#522
- [2017-09-02 00:03] Validation started with lhcb-future-clang#300
- [2017-09-03 00:03] Validation started with lhcb-future#523
- [2017-09-03 00:04] Validation started with lhcb-future-clang#301
- [2017-09-04 00:04] Validation started with lhcb-future-clang#302
- [2017-09-04 00:04] Validation started with lhcb-future#524
- [2017-09-05 00:03] Validation started with lhcb-future#525
- [2017-09-05 00:04] Validation started with lhcb-future-clang#303
- [2017-09-06 00:03] Validation started with lhcb-future#526
- [2017-09-06 00:04] Validation started with lhcb-future-clang#304
- [2017-09-07 00:03] Validation started with lhcb-future-clang#305
- [2017-09-07 00:04] Validation started with lhcb-future#527
- [2017-09-08 00:03] Validation started with lhcb-future#528
- [2017-09-08 00:03] Validation started with lhcb-future-clang#306
- [2017-09-09 00:03] Validation started with lhcb-future-clang#307
- [2017-09-09 00:03] Validation started with lhcb-future#529
- [2017-09-10 00:03] Validation started with lhcb-future#530
- [2017-09-10 00:04] Validation started with lhcb-future-clang#308
- [2017-09-11 00:03] Validation started with lhcb-future#531
- [2017-09-11 00:04] Validation started with lhcb-future-clang#309
- [2017-09-12 00:04] Validation started with lhcb-future#532
- [2017-09-12 00:04] Validation started with lhcb-future-clang#310
- [2017-09-13 00:03] Validation started with lhcb-future#533
- [2017-09-13 00:04] Validation started with lhcb-future-clang#311
- [2017-09-14 00:03] Validation started with lhcb-future#534
- [2017-09-14 00:04] Validation started with lhcb-future-clang#312
- [2017-09-15 00:02] Validation started with lhcb-future-clang#313
- [2017-09-15 00:03] Validation started with lhcb-future#535
- [2017-09-16 00:02] Validation started with lhcb-future#536
- [2017-09-16 00:03] Validation started with lhcb-future-clang#314
- [2017-09-17 00:03] Validation started with lhcb-future-clang#315
- [2017-09-17 00:03] Validation started with lhcb-future#537
- [2017-09-18 00:03] Validation started with lhcb-future#538
- [2017-09-18 00:04] Validation started with lhcb-future-clang#316
- [2017-09-19 00:03] Validation started with lhcb-future#539
- [2017-09-19 00:03] Validation started with lhcb-future-clang#317
Edited by Software for LHCb- Resolved by Marco Clemencic
assigned to @clemenci
changed milestone to %v29r0
assigned to @hegner
Rebasing is something I haven't fully got to grips with... I think I have rebased the branch to master in my local checkout
git rebase master
but when I try and push that to gitlab I get
CernVM ~/LHCbCMake/Master/Gaudi > git push origin GaudiKernel-Property-DefaultInitTemp To ssh://git@gitlab.cern.ch:7999/jonrob/Gaudi.git ! [rejected] GaudiKernel-Property-DefaultInitTemp -> GaudiKernel-Property-DefaultInitTemp (non-fast-forward) error: failed to push some refs to 'ssh://git@gitlab.cern.ch:7999/jonrob/Gaudi.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
Presumably I am doing this wrong ?
No, this is just git's way of telling you that rebasing is a fairly invasive operation that alters the commit history in a fashion that could confuse anyone who would have based work on your remote branch.
Since there is no risk of this happening on this MR originating from your private fork, you can press the "I know what I'm doing" big red button by adding the
--force
switch (or, its shorthand,-f
) to yourgit push
command.Edited by Hadrien Benjamin Graslandadded 37 commits
-
d6af2fb3...eb8958e6 - 30 commits from branch
gaudi:master
- 01206dbf - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi
- 96a6ccf9 - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi
- f75c4a8f - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi
- b8fe71d8 - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi
- 933eaa1e - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi
- 8653b0e9 - Merge branch 'master' of ssh://gitlab.cern.ch:7999/jonrob/Gaudi
- 971556e7 - Default initialise temporary used in fromString method
Toggle commit list-
d6af2fb3...eb8958e6 - 30 commits from branch
mentioned in commit 72f52a3d