Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build support for gcc < 5.x #11

Merged
merged 1 commit into from
Sep 28, 2018
Merged

Build support for gcc < 5.x #11

merged 1 commit into from
Sep 28, 2018

Conversation

rexut
Copy link
Contributor

@rexut rexut commented Aug 13, 2018

Implicit casts of QPointer<T>& in signal/slot connection

There are many compile errors on implicit casts of QPointer<T>& in signal/slot connection when building with GCC < 5.x. The following error happens when building with GCC 4.8.4:

... no matching function for call to ‘QObject::connect(QPointer<T>&, ...)’
... no matching function for call to ‘QObject::disconnect(QPointer<T>&, ...)’

It's apparently a compiler bug that fixed in GCC 5.x and later. However, working around it is not very costly, and GCC 4.8 is supposed to should be supported. Similar report in Qt Bug Database QTBUG-69512.

src/card/base/CardConnectionWorker.cpp (Click to expand)
/tmp/AusweisApp2/src/card/base/CardConnectionWorker.cpp: In constructor ‘governikus::CardConnectionWorker::CardConnectionWorker(governikus::Reader*)’:
/tmp/AusweisApp2/src/card/base/CardConnectionWorker.cpp:21:94: error: no matching function for call to ‘governikus::CardConnectionWorker::connect(QPointer&, void (governikus::Reader::*)(const QString&), governikus::CardConnectionWorker* const, void (governikus::CardConnectionWorker::*)(const QString&))’
  connect(mReader, &Reader::fireCardInserted, this, &CardConnectionWorker::onReaderInfoChanged);
                                                                                              ^
/tmp/AusweisApp2/src/card/base/CardConnectionWorker.cpp:21:94: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mReader, &Reader::fireCardInserted, this, &CardConnectionWorker::onReaderInfoChanged);
                                                                                              ^
...
/tmp/AusweisApp2/src/card/base/CardConnectionWorker.cpp:22:93: error: no matching function for call to ‘governikus::CardConnectionWorker::connect(QPointer&, void (governikus::Reader::*)(const QString&), governikus::CardConnectionWorker* const, void (governikus::CardConnectionWorker::*)(const QString&))’
  connect(mReader, &Reader::fireCardRemoved, this, &CardConnectionWorker::onReaderInfoChanged);
                                                                                             ^
/tmp/AusweisApp2/src/card/base/CardConnectionWorker.cpp:22:93: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mReader, &Reader::fireCardRemoved, this, &CardConnectionWorker::onReaderInfoChanged);
                                                                                             ^
...
/tmp/AusweisApp2/src/card/base/CardConnectionWorker.cpp:23:105: error: no matching function for call to ‘governikus::CardConnectionWorker::connect(QPointer&, void (governikus::Reader::*)(const QString&), governikus::CardConnectionWorker* const, void (governikus::CardConnectionWorker::*)(const QString&))’
  connect(mReader, &Reader::fireCardRetryCounterChanged, this, &CardConnectionWorker::onReaderInfoChanged);
                                                                                                         ^
/tmp/AusweisApp2/src/card/base/CardConnectionWorker.cpp:23:105: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mReader, &Reader::fireCardRetryCounterChanged, this, &CardConnectionWorker::onReaderInfoChanged);
                                                                                                         ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-gnu-zero-variadic-macro-arguments" [enabled by default]
src/qml/HistoryModel.cpp (Click to expand)
/tmp/AusweisApp2/src/qml/HistoryModel.cpp: In constructor ‘governikus::HistoryModel::HistoryModel(governikus::HistorySettings*, QObject*)’:
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:122:115: error: no matching function for call to ‘governikus::HistoryModel::connect(QPointer&, void (governikus::HistorySettings::*)(), governikus::HistoryModel* const, void (governikus::HistoryModel::*)())’
  connect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged);
                                                                                                                   ^
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:122:115: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged);
                                                                                                                   ^
...
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:123:105: error: no matching function for call to ‘governikus::HistoryModel::connect(QPointer&, void (governikus::HistorySettings::*)(bool), governikus::HistoryModel* const, void (governikus::HistoryModel::*)(bool))’
  connect(mHistorySettings, &HistorySettings::fireEnabledChanged, this, &HistoryModel::fireEnabledChanged);
                                                                                                         ^
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:123:105: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mHistorySettings, &HistorySettings::fireEnabledChanged, this, &HistoryModel::fireEnabledChanged);
                                                                                                         ^
...
/tmp/AusweisApp2/src/qml/HistoryModel.cpp: In member function ‘virtual bool governikus::HistoryModel::removeRows(int, int, const QModelIndex&)’:
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:369:118: error: no matching function for call to ‘governikus::HistoryModel::disconnect(QPointer&, void (governikus::HistorySettings::*)(), governikus::HistoryModel* const, void (governikus::HistoryModel::*)())’
  disconnect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged);
                                                                                                                      ^
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:369:118: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  disconnect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged);
                                                                                                                      ^
...
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:371:115: error: no matching function for call to ‘governikus::HistoryModel::connect(QPointer&, void (governikus::HistorySettings::*)(), governikus::HistoryModel* const, void (governikus::HistoryModel::*)())’
  connect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged);
                                                                                                                   ^
/tmp/AusweisApp2/src/qml/HistoryModel.cpp:371:115: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged);
                                                                                                                   ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-gnu-zero-variadic-macro-arguments" [enabled by default]
src/widget/DiagnosisGui.cpp (Click to expand)
/tmp/AusweisApp2/src/widget/DiagnosisGui.cpp: In member function ‘void governikus::DiagnosisGui::activate()’:
/tmp/AusweisApp2/src/widget/DiagnosisGui.cpp:50:72: error: no matching function for call to ‘governikus::DiagnosisGui::connect(QPointer&, void (QDialog::*)(int), governikus::DiagnosisGui* const, void (governikus::DiagnosisGui::*)())’
  connect(mDialog, &QDialog::finished, this, &DiagnosisGui::fireFinished);
                                                                        ^
/tmp/AusweisApp2/src/widget/DiagnosisGui.cpp:50:72: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mDialog, &QDialog::finished, this, &DiagnosisGui::fireFinished);
                                                                        ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-gnu-zero-variadic-macro-arguments" [enabled by default]
src/widget/SetupAssistantGui.cpp (Click to expand)
/tmp/AusweisApp2/src/widget/SetupAssistantGui.cpp: In member function ‘void governikus::SetupAssistantGui::activate()’:
/tmp/AusweisApp2/src/widget/SetupAssistantGui.cpp:39:123: error: no matching function for call to ‘governikus::SetupAssistantGui::connect(QPointer&, void (governikus::SetupAssistantWizard::*)(), governikus::SetupAssistantGui* const, void (governikus::SetupAssistantGui::*)())’
   connect(mWizard, &SetupAssistantWizard::fireChangePinButtonClicked, this, &SetupAssistantGui::fireChangePinButtonClicked);
                                                                                                                           ^
/tmp/AusweisApp2/src/widget/SetupAssistantGui.cpp:39:123: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
   connect(mWizard, &SetupAssistantWizard::fireChangePinButtonClicked, this, &SetupAssistantGui::fireChangePinButtonClicked);
                                                                                                                           ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-gnu-zero-variadic-macro-arguments" [enabled by default]
src/widget/step/StepChooseCardGui.cpp (Click to expand)
/tmp/AusweisApp2/src/widget/step/StepChooseCardGui.cpp: In constructor ‘governikus::StepChooseCardGui::StepChooseCardGui(const QSharedPointer&, governikus::AuthenticateStepsWidget*)’:
/tmp/AusweisApp2/src/widget/step/StepChooseCardGui.cpp:42:105: error: no matching function for call to ‘governikus::StepChooseCardGui::connect(QPointer&, void (governikus::ReaderDeviceGui::*)(), governikus::StepChooseCardGui* const, void (governikus::StepChooseCardGui::*)())’
  connect(mReaderDeviceGui, &ReaderDeviceGui::fireFinished, this, &StepChooseCardGui::onSubDialogFinished);
                                                                                                         ^
/tmp/AusweisApp2/src/widget/step/StepChooseCardGui.cpp:42:105: note:   mismatched types ‘const typename QtPrivate::FunctionPointer::Object*’ and ‘QPointer’
  connect(mReaderDeviceGui, &ReaderDeviceGui::fireFinished, this, &StepChooseCardGui::onSubDialogFinished);
                                                                                                         ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-gnu-zero-variadic-macro-arguments" [enabled by default]

@CLAassistant
Copy link

CLAassistant commented Aug 13, 2018

CLA assistant check
All committers have signed the CLA.

@rexut rexut changed the title travis: temporary workaround for Alpine bug 9238 Fix Travis-CI and build support for gcc < 5.x Aug 13, 2018
@misery
Copy link
Contributor

misery commented Aug 23, 2018

Thanks for your pull request!
I already merged the gcc stuff into our internal mainline branch. But what is the reason to use that gcc version?

By the way... we support gcc 4.9 and higher. But this change is tiny enough to accept it.

@rexut
Copy link
Contributor Author

rexut commented Sep 10, 2018

I already merged the gcc stuff into our internal mainline branch.

Thx

... But what is the reason to use that gcc version?

Some of the current Linux distributions with long-time support primarily only offer older GCC versions, for example CentOS and Red Hat Enterprise Linux 7 offer gcc 4.8.x (see: What gcc versions are available in Red Hat Enterprise Linux?), CentOS and RHEL 6 even only gcc 4.4.x. Both versions promise a lifetime beyond 2020, see: End-of-support schedule. Under these circumstances, it would not be possible to build the AusweisApp2 on these systems without additional changes, which is often not allowed in the Enterprise domain.

@misery
Copy link
Contributor

misery commented Sep 27, 2018

Sorry for the delay! Certainly you perceived that Alpine fixed your report. So you could drop the work-around changeset. After that I will merge this PR. :-)

The following error happens when building with GCC 4.8.5:

    no matching function for call to ‘QObject::connect(QPointer<T>&, ...)’
    no matching function for call to ‘QObject::disconnect(QPointer<T>&, ...)’

There is a simular problem in qtlocation, see Qt bug report:

    https://bugreports.qt.io/browse/QTBUG-69512

It's apparently a compiler bug fixed in GCC 5.x and later.

Signed-off-by: Stephan Linz <[email protected]>
@rexut
Copy link
Contributor Author

rexut commented Sep 28, 2018

The Alpine bug report 9238 was successfully closed. I've revert this change in this pull-request #11. Now I'll change the title and description.

@rexut rexut changed the title Fix Travis-CI and build support for gcc < 5.x Build support for gcc < 5.x Sep 28, 2018
@misery misery merged commit 06836ad into Governikus:community Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants