From 651c612eda2074d6215f0a36b9fee5c4b513695b Mon Sep 17 00:00:00 2001 From: LoudSnorer Date: Sat, 18 Feb 2023 18:42:41 -0500 Subject: [PATCH] enforce Errors For Warnings deprecated-copy deprecated-declarations stringop-overread --- oscar/SleepLib/appsettings.h | 1 + .../loader_plugins/mseries_loader.cpp | 6 +++-- .../SleepLib/loader_plugins/mseries_loader.h | 4 ++++ oscar/mainwindow.cpp | 1 + oscar/oscar.pro | 23 +++++++++++-------- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/oscar/SleepLib/appsettings.h b/oscar/SleepLib/appsettings.h index b6f75e6c..6fc1dedc 100644 --- a/oscar/SleepLib/appsettings.h +++ b/oscar/SleepLib/appsettings.h @@ -25,6 +25,7 @@ class Preferences; enum OverviewLinechartModes { OLC_Bartop, OLC_Lines }; #endif +#define REMSTAR_M_SUPPORTdisabled // ApplicationWideSettings Strings const QString STR_CS_UserEventPieChart = "UserEventPieChart"; diff --git a/oscar/SleepLib/loader_plugins/mseries_loader.cpp b/oscar/SleepLib/loader_plugins/mseries_loader.cpp index 2102bf42..06ac9132 100644 --- a/oscar/SleepLib/loader_plugins/mseries_loader.cpp +++ b/oscar/SleepLib/loader_plugins/mseries_loader.cpp @@ -7,11 +7,12 @@ * License. See the file COPYING in the main directory of the source code * for more details. */ +#include "mseries_loader.h" +#ifdef REMSTAR_M_SUPPORT + #include #include -#include "mseries_loader.h" - // The qt5.15 obsolescence of hex requires this change. // this solution to QT's obsolescence is only used in debug statements #if QT_VERSION >= QT_VERSION_CHECK(5,15,0) @@ -499,3 +500,4 @@ void MSeriesLoader::Register() //InitModelMap(); mseries_initialized = true; } +#endif // REMSTAR_M_SUPPORT diff --git a/oscar/SleepLib/loader_plugins/mseries_loader.h b/oscar/SleepLib/loader_plugins/mseries_loader.h index 1cd35d01..17d9044b 100644 --- a/oscar/SleepLib/loader_plugins/mseries_loader.h +++ b/oscar/SleepLib/loader_plugins/mseries_loader.h @@ -13,6 +13,9 @@ #ifndef MSERIES_LOADER_H #define MSERIES_LOADER_H +#include "SleepLib/appsettings.h" +#ifdef REMSTAR_M_SUPPORT + #include "SleepLib/machine.h" #include "SleepLib/machine_loader.h" #include "SleepLib/profiles.h" @@ -74,4 +77,5 @@ class MSeriesLoader : public MachineLoader quint32 epoch; }; +#endif // REMSTAR_M_SUPPORT #endif // MSERIES_LOADER_H diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index 3078be97..9192d562 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -42,6 +42,7 @@ #include "common_gui.h" #include "version.h" +#include "SleepLib/appsettings.h" // defines for REMSTAR_M_SUPPORT // Custom loaders that don't autoscan.. diff --git a/oscar/oscar.pro b/oscar/oscar.pro index cd8d9ab2..3c82b338 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -551,23 +551,26 @@ gcc | clang { gcc:!clang { message("Building for $$QMAKE_HOST.os") - greaterThan(COMPILER_MAJOR, 10) : { - QMAKE_CFLAGS += -Wno-error=stringop-overread - QMAKE_CXXFLAGS += -Wno-error=stringop-overread - message("Making stringop-overread a non-error") - } + # this section removedi. stringop-overread was only trigger by mseries_loader:: OPen method + #greaterThan(COMPILER_MAJOR, 10) : { + # QMAKE_CFLAGS += -Wno-error=stringop-overread + # QMAKE_CXXFLAGS += -Wno-error=stringop-overread + # message("Making stringop-overread a non-error") + #} } clang { message("Building for $$QMAKE_HOST.os") - greaterThan(COMPILER_MAJOR, 9) : { - QMAKE_CFLAGS_WARN_ON += -Wno-error=deprecated-copy - QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-copy - message("Making deprecated-copy a non-error") - } + # this section removedi. all deprecated-copy errors have been removed + #greaterThan(COMPILER_MAJOR, 9) : { + # QMAKE_CFLAGS_WARN_ON += -Wno-error=deprecated-copy + # QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-copy + # message("Making deprecated-copy a non-error") + #} } # Make deprecation warnings just warnings +# these two removed. all deprecated-declarations errors have been removed QMAKE_CFLAGS += -Wno-error=deprecated-declarations QMAKE_CXXFLAGS += -Wno-error=deprecated-declarations