Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77914

Build warning of non-void return from function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.14.0 Beta2
    • 5.12.3
    • WebEngine
    • None
    • Linux/X11

    Description

      Building 5.12.3 systems. A quick glance at logs revealed a warning message from gcc (v9.1.1-r8) of a non-void function missing a return value.

      From log file

      [13565/22834] /usr/bin/x86_64-pc-linux-gnu-g++ -MMD -MF obj/cc/cc/snap_fling_controller.o.d -DCC_IMPLEMENTATION=1 -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DLEVELDB_PLATFORM_CHROMIUM=1 -DMESA_EGL_NO_X11_HEADERS -Igen -I../../3rdparty/chromium -Igen -Igen -Igen -Igen -Igen -Igen -I../../3rdparty/chromium/third_party/khronos -I../../3rdparty/chromium/gpu -I../../3rdparty/chromium/third_party/libyuv/include -Igen -Igen -Igen -Igen -Igen -Igen -Igen -I../../3rdparty/chromium/skia/config -I../../3rdparty/chromium/skia/ext -I../../3rdparty/chromium/third_party/skia/include/c -I../../3rdparty/chromium/third_party/skia/include/config -I../../3rdparty/chromium/third_party/skia/include/core -I../../3rdparty/chromium/third_party/skia/include/effects -I../../3rdparty/chromium/third_party/skia/include/encode -I../../3rdparty/chromium/third_party/skia/include/gpu -I../../3rdparty/chromium/third_party/skia/include/images -I../../3rdparty/chromium/third_party/skia/include/lazy -I../../3rdparty/chromium/third_party/skia/include/pathops -I../../3rdparty/chromium/third_party/skia/include/pdf -I../../3rdparty/chromium/third_party/skia/include/pipe -I../../3rdparty/chromium/third_party/skia/include/ports -I../../3rdparty/chromium/third_party/skia/include/utils -I../../3rdparty/chromium/third_party/skia/src/gpu -I../../3rdparty/chromium/third_party/skia/src/sksl -I../../3rdparty/chromium/third_party/protobuf/src -Igen/protoc_out -Igen/third_party/metrics_proto -I../../3rdparty/chromium/third_party/protobuf/src -I../../3rdparty/chromium/third_party/ced/src -I../../3rdparty/chromium/third_party/libwebm/source -I../../3rdparty/chromium/third_party/leveldatabase -I../../3rdparty/chromium/third_party/leveldatabase/src -I../../3rdparty/chromium/third_party/leveldatabase/src/include -I../../3rdparty/chromium/third_party/mesa/src/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -m64 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-dangling-else -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -std=gnu++14 -Wno-narrowing -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../3rdparty/chromium/cc/input/snap_fling_controller.cc -o obj/cc/cc/snap_fling_controller.o
      ../../3rdparty/chromium/cc/input/snap_fling_controller.cc: In member function ‘bool cc::SnapFlingController::FilterEventForSnap(cc::SnapFlingController::GestureScrollType)’:
      ../../3rdparty/chromium/cc/input/snap_fling_controller.cc:30:1: warning: control reaches end of non-void function [-Wreturn-type]
         30 | }
            | ^
      

      Configure summary from log file

      Qt WebEngine:
        Embedded build ......................... no
        Pepper Plugins ......................... yes
        Printing and PDF ....................... yes
        Proprietary Codecs ..................... yes
        Spellchecker ........................... yes
        Native Spellchecker .................... no
        WebRTC ................................. yes
        Use System Ninja ....................... yes
        Geolocation ............................ yes
        WebChannel support ..................... yes
        Use v8 snapshot ........................ yes
        Kerberos Authentication ................ no
        Use ALSA ............................... yes
        Use PulseAudio ......................... no
        Optional system libraries used:
          re2 .................................. yes
          icu .................................. yes
          libwebp, libwebpmux and libwebpdemux . yes
          opus ................................. yes
          ffmpeg ............................... yes
          libvpx ............................... no
          snappy ............................... yes
          glib ................................. yes
          zlib ................................. yes
          minizip .............................. yes
          libevent ............................. yes
          jsoncpp .............................. yes
          protobuf ............................. no
          libxml2 and libxslt .................. yes
          lcms2 ................................ yes
          png .................................. yes
          JPEG ................................. yes
          harfbuzz ............................. yes
          freetype ............................. yes
          x11 .................................. yes
        Required system libraries:
          fontconfig ........................... yes
          dbus ................................. yes
          nss .................................. yes
          khr .................................. yes
          glibc ................................ yes
        Required system libraries for qpa-xcb:
          libdrm ............................... yes
          xcomposite ........................... yes
          xcursor .............................. yes
          xi ................................... yes
          xtst ................................. yes
      

      Examined file src/3rdparty/chromium/cc/input/snap_fling_controller.cc shows a handful of switch statements which trigger an early return from function. However, SnapFlingController::FilterEventForSnap function does not have a return value should execution fall through case statements.

      Simple fix is to have function return false should execution falls through case statements.

      diff --git a/src/3rdparty/chromium/cc/input/snap_fling_controller.cc b/src/3rdparty/chromium/cc/input/snap_fling_controller.cc
      index 4c8e485..2df10b6 100644
      --- a/src/3rdparty/chromium/cc/input/snap_fling_controller.cc
      +++ b/src/3rdparty/chromium/cc/input/snap_fling_controller.cc
      @@ -27,6 +27,7 @@ bool SnapFlingController::FilterEventForSnap(
             return state_ == State::kActive || state_ == State::kFinished;
           }
         }
      +  return false;
       }
       
       void SnapFlingController::ClearSnapFling() {
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              digifuzzy Scott Furry
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes