From 6c03da966af74bbf49509d5f187444ea5b7b0ac4 Mon Sep 17 00:00:00 2001 From: harre Date: Tue, 18 May 2021 01:19:12 +0200 Subject: [PATCH 1/2] GCC 11 build fix on arch #34 --- oscar/oscar.pro | 25 ++++++++++++++++++++----- oscar/oximeterimport.cpp | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/oscar/oscar.pro b/oscar/oscar.pro index b2f8e977..e786f8f9 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -493,18 +493,33 @@ DISTFILES += help/default.css \ QMAKE_CFLAGS += -Werror QMAKE_CXXFLAGS += -Werror + gcc | clang { COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion") - COMPILER_MAJOR = $$str_member($$COMPILER_VERSION) - greaterThan(COMPILER_MAJOR, 9) : { - QMAKE_CFLAGS += -Wno-error=depreciated-copy - QMAKE_CXX_FLAGS += -Wno-error=depreciated-copy - message("Removing depreciated-copy error") + COMPILER_MAJOR = $$split(COMPILER_VERSION, ".") + COMPILER_MAJOR = $$first(COMPILER_MAJOR) + + message("$$QMAKE_CXX major version $$COMPILER_MAJOR") + + greaterThan(COMPILER_MAJOR, 10) : { + QMAKE_CFLAGS += -Wno-error=stringop-overread + QMAKE_CXXFLAGS += -Wno-error=stringop-overread + message("Removing stringop-overread error") } + else { + greaterThan(COMPILER_MAJOR, 9) : { + QMAKE_CFLAGS += -Wno-error=depreciated-copy + QMAKE_CXXFLAGS += -Wno-error=depreciated-copy + message("Removing depreciated-copy error") + } + } + } + # Make deprecation warnings just warnings QMAKE_CFLAGS += -Wno-error=deprecated-declarations QMAKE_CXXFLAGS += -Wno-error=deprecated-declarations + lessThan(QT_MAJOR_VERSION,5)|lessThan(QT_MINOR_VERSION,9) { QMAKE_CFLAGS += -Wno-error=strict-aliasing QMAKE_CXXFLAGS += -Wno-error=strict-aliasing diff --git a/oscar/oximeterimport.cpp b/oscar/oximeterimport.cpp index af6f50fa..38cb98a4 100644 --- a/oscar/oximeterimport.cpp +++ b/oscar/oximeterimport.cpp @@ -407,7 +407,7 @@ void OximeterImport::on_fileImportButton_clicked() if (documentsFolder.isEmpty()) documentsFolder = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); - qDebug() << "oximod - File Import button clicked"; + qDebug() << "oximod - File Import button clicked"; QString filename = QFileDialog::getOpenFileName(nullptr , tr("Select a valid oximetry data file"), documentsFolder, tr("Oximetry Files (*.spo *.spor *.spo2 *.SpO2 *.dat)")); From 5126c215f410bb04ce4148d2ee04b1790547935c Mon Sep 17 00:00:00 2001 From: harre Date: Tue, 18 May 2021 01:19:12 +0200 Subject: [PATCH 2/2] Remove not needed ignored warning as code got fixed already #25 --- oscar/oscar.pro | 7 ------- 1 file changed, 7 deletions(-) diff --git a/oscar/oscar.pro b/oscar/oscar.pro index e786f8f9..f90ac25d 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -506,13 +506,6 @@ gcc | clang { QMAKE_CXXFLAGS += -Wno-error=stringop-overread message("Removing stringop-overread error") } - else { - greaterThan(COMPILER_MAJOR, 9) : { - QMAKE_CFLAGS += -Wno-error=depreciated-copy - QMAKE_CXXFLAGS += -Wno-error=depreciated-copy - message("Removing depreciated-copy error") - } - } }