configure: disable -Wmaybe-uninitialized
gcc produces the following warning at -O2, breaking the CI:
CXX msg-iter.lo
/home/simark/src/babeltrace/src/plugins/ctf/common/src/msg-iter.cpp: In member function 'virtual void ctf::src::internal::MsgIterItemVisitor::visit(const ctf::src::PktInfoItem&)':
/home/simark/src/babeltrace/src/plugins/ctf/common/src/msg-iter.cpp:132:87: error: '*(nonstd::optional_lite::optional<long long unsigned int>::value_type*)((char*)&prevPacketEndDefClkVal + offsetof(nonstd::optio
nal_lite::optional<long long unsigned int>,nonstd::optional_lite::optional<long long unsigned int>::contained))' may be used uninitialized [-Werror=maybe-uninitialized]
132 | msg = bt_message_discarded_packets_create_with_default_clock_snapshots(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
133 | _mSelfMsgIter, _mLibStream.libObjPtr(), *prevPacketEndDefClkVal,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134 | *_mPacketBeginDefClkVal);
| ~~~~~~~~~~~~~~~~~~~~~~~~
/home/simark/src/babeltrace/src/plugins/ctf/common/src/msg-iter.cpp:76:42: note: '*(nonstd::optional_lite::optional<long long unsigned int>::value_type*)((char*)&prevPacketEndDefClkVal + offsetof(nonstd::optiona
l_lite::optional<long long unsigned int>,nonstd::optional_lite::optional<long long unsigned int>::contained))' was declared here
76 | nonstd::optional<unsigned long long> prevPacketEndDefClkVal = _mPacketEndDefClkVal;
| ^~~~~~~~~~~~~~~~~~~~~~
I don't see anything wrong with the code, the compiler just seems
unhappy with the fact that the value part of the optional will possibly
be uninitialized.
I tried to disable -Wmaybe-uninitialized at specific spots, but it's too
difficult. We get different spurious warnings on different
architectures, at different optimization levels, so it's going to end up
as a whack-a-mole game. My previous experience is that this warning
generates a lot of noise and rarely leads to real bug fixes anyway.
Change-Id: Ia013447ee3659954d010b0c4e29b567bc40b6ee7
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8351
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.024763 seconds and 4 git commands to generate.