Uploaded image for project: 'Apache NiFi MiNiFi C++'
  1. Apache NiFi MiNiFi C++
  2. MINIFICPP-1563

Fix Wmaybe-uninitialized warnings (tested on GCC 10.3 and 11.1)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 0.10.0
    • None

    Description

      ../extensions/mqtt/../../libminifi/include/c2/PayloadSerializer.h: In function ‘static bool org::apache::nifi::minifi::c2::PayloadSerializer::deserializePayload(org::apache::nifi::minifi::c2::C2Payload&, org::apache::nifi::minifi::c2::Operation, std::string, org::apache::nifi::minifi::io::BaseStream*)’:
      ../extensions/mqtt/../../libminifi/include/c2/PayloadSerializer.h:233:111: error: st’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      233 |       C2Payload subPayload(operation, st == 1 ? state::UpdateState::NESTED : state::UpdateState::READ_COMPLETE);
      |                                                                                                               ^
      ../extensions/mqtt/../../libminifi/include/c2/PayloadSerializer.h:303:5: error: op’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      303 |     switch (op) {
      |     ^~~~~~
      ../extensions/mqtt/../../libminifi/include/c2/PayloadSerializer.h:225:13: note: op’ was declared here
      225 |     uint8_t op, st;
      |             ^~
      ../extensions/mqtt/../../libminifi/include/c2/PayloadSerializer.h: In member function ‘virtual void org::apache::nifi::minifi::processors::ConvertHeartBeat::onTrigger(const std::shared_ptr<org::apache::nifi::minifi::core::ProcessContext>&, const std::shared_ptr<org::apache::nifi::minifi::core::ProcessSession>&)’:
      ../extensions/mqtt/../../libminifi/include/c2/PayloadSerializer.h:303:5: error: op’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      303 |     switch (op) {
      |     ^~~~~~
      ../extensions/mqtt/../../libminifi/include/c2/PayloadSerializer.h:260:13: note: op’ was declared here
      260 |     uint8_t op, st = 0;
      |             ^~

       

      and more...

      Attachments

        Activity

          People

            szaszm Marton Szasz
            szaszm Marton Szasz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m