IENT / YUView

The Free and Open Source Cross Platform YUV Viewer with an advanced analytics toolset
http://ient.github.io/YUView
Other
1.88k stars 369 forks source link

Qt6 debug build failure #516

Closed 1div0 closed 1 year ago

1div0 commented 1 year ago

Compilation failure w/ Qt6

To Reproduce € qmake6 -spec linux-clang ../../YUView.pro CONFIG+=debug

Version (please complete the following information):

This package contains base tools, like string, xml, and network handling.

In file included from /2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/ui/ViewStateHandler.cpp:33: /2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/ui/ViewStateHandler.h:51:33: error: base class has incomplete type class ViewStateHandler : public QObject


/usr/include/qt6/QtCore/qscopedpointer.h:65:7: note: forward declaration of 'QObject'
class QObject;
      ^
In file included from /2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/ui/ViewStateHandler.cpp:33:
In file included from /2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/ui/ViewStateHandler.h:36:
In file included from /usr/include/qt6/QtCore/QPointer:1:
/usr/include/qt6/QtCore/qpointer.h:38:17: error: static_cast from 'ViewStateHandler *' to 'QPointer<ViewStateHandler>::QObjectType *' (aka 'QObject *'), which are not related by inheritance, is not allowed
    { wp.assign(static_cast<QObjectType*>(p)); return *this; }
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/ui/widgets/PlaylistTreeWidget.h:82:70: note: in instantiation of member function 'QPointer<ViewStateHandler>::operator=' requested here
  void setViewStateHandler(ViewStateHandler *handler) { stateHandler = handler; }
                                                                     ^
2 errors generated.
make[1]: *** [Makefile:3925: src/ui/ViewStateHandler.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/video/videoHandlerYUV.cpp:3446:16: warning: variable 'convOK' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      else if (yuvFormat.getBitsPerSample() == 10)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/video/videoHandlerYUV.cpp:3476:10: note: uninitialized use occurs here
  assert(convOK);
         ^~~~~~
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^~~~
/2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/video/videoHandlerYUV.cpp:3446:12: note: remove the 'if' if its condition is always true
      else if (yuvFormat.getBitsPerSample() == 10)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/2TB/usr/src/github.com/1div0/YUView/YUViewLib/src/video/videoHandlerYUV.cpp:3429:14: note: initialize the variable 'convOK' to silence this warning
  bool convOK;
             ^
              = false
1 warning generated.
make[1]: Leaving directory '/2TB/usr/src/github.com/1div0/YUView/Linux/x86-64/YUViewLib'
make: *** [Makefile:48: sub-YUViewLib-make_first] Error 2
ChristianFeldmann commented 1 year ago

Thx for the report. I could reproduce this in a docker fedora image. Probably something with a newer version of clang. Also happens in release mode.

ChristianFeldmann commented 1 year ago

Was able to reproduce it on macos12 with clang and Qt6. Was not able to reproduce on Ubuntu 20 with Qt5 and clang.

1div0 commented 1 year ago

Checked out the feature/addUpToDateCI branch and compiled OK.

Danke schön.

ChristianFeldmann commented 1 year ago

Yep I am just looking at some warnings with the new Qt version. I will add the new macOS and Ubuntu version to the CI so that this will keep building also with the newest version.

ChristianFeldmann commented 1 year ago

PR was merged