configure: disable -Wmaybe-uninitialized
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 14 Jun 2022 13:38:57 +0000 (09:38 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 15 Jun 2022 18:37:34 +0000 (14:37 -0400)
commit419d8c49bd978a59b8a0619d83cb6ba26b18f970
tree953051959a4b1bcd542eba34088e08aefe514826
parent6a442676d02cabb5d4954bb8ca9a27ce83584ad4
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>
configure.ac
This page took 0.024306 seconds and 4 git commands to generate.