Supress warnings about nodiscard in dictionary generation with ROOT 6.22
Merge request reports
Activity
added lhcb-lcg-test label
- Resolved by Christoph Hasse
I recently ran into a similar problem (see the discussion lhcb/LHCb!2932 (merged)) where I added
[[nodiscard]]
which clang does recognise, but the dictionary generating code then caused clang to emit the following diagnositic:input_line_182:10:7: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result] ((const LHCb::RawEvent*)obj)->banks(*(LHCb::RawBank::BankType*)args[0]);
i.e. the dictionary code seems to generate function calls which have 'no effect' -- and I removed the
[[nodiscard]]
again. It would be much nicer if the generated code actively would avoid such warnings (as presumably it has good reasons to call this code, eg. make sure that the relevant symbol is linked into the library) and be changed to cast the result tovoid
, i.e.:(void)((const LHCb::RawEvent*)obj)->banks(*(LHCb::RawBank::BankType*)args[0]);
as shown eg here Unfortunately, I never found out where the code is that generates this code....
Edited by Gerhard Raven
- Resolved by Marco Clemencic
- Resolved by Christoph Hasse
Just as a side note, the failure in the pipeline comes from a change in https://gitlab.cern.ch/lhcb-core/lcg-toolchains.
If you rebase on master it goes away.
added 19 commits
-
b94384b7...f79f7a2c - 18 commits from branch
master
- d53edcc3 - gaudi_add_dictionary: if ROOT 6.22 then add -Wno-unknown-attributes to...
-
b94384b7...f79f7a2c - 18 commits from branch
- [2021-02-23 00:43] Validation started with lhcb-lcg-test#119
- [2021-02-24 00:55] Validation started with lhcb-lcg-test#120
- [2021-02-25 00:38] Validation started with lhcb-lcg-test#121
- [2021-02-26 00:29] Validation started with lhcb-lcg-test#122
- [2021-02-26 01:14] Validation started with lhcb-lcg-test#122
- [2021-02-27 00:37] Validation started with lhcb-lcg-test#123
- [2021-02-28 00:06] Validation started with lhcb-lcg-test#124
- [2021-03-02 00:16] Validation started with lhcb-lcg-test#125
- [2021-03-03 00:30] Validation started with lhcb-lcg-test#126
- [2021-03-04 00:36] Validation started with lhcb-lcg-test#127
- [2021-03-05 00:31] Validation started with lhcb-lcg-test#128
- [2021-03-06 00:05] Validation started with lhcb-gaudi-head#2870
- [2021-03-06 00:25] Validation started with lhcb-lcg-test#129
- [2021-03-06 00:53] Validation started with lhcb-run2-gaudi-head#79
- [2021-03-07 00:03] Validation started with lhcb-gaudi-head#2871
- [2021-03-07 00:10] Validation started with lhcb-lcg-test#130
- [2021-03-07 00:25] Validation started with lhcb-run2-gaudi-head#80
- [2021-03-07 10:54] Validation started with lhcb-gaudi-head#2872
- [2021-03-08 00:06] Validation started with lhcb-gaudi-head#2873
- [2021-03-08 00:12] Validation started with lhcb-lcg-test#131
- [2021-03-08 00:38] Validation started with lhcb-run2-gaudi-head#81
- [2021-03-08 01:10] Validation started with lhcb-run2-gaudi-head#81
Edited by Software for LHCbchanged milestone to %v35r2
assigned to @clemenci
added lhcb-gaudi-head label
mentioned in merge request !1183 (merged)
mentioned in commit 30ea297c