Right way to suppress GCC warning Wstrict-overflow for method QVector::move().

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-09-29 17:13:30 +03:00
parent 8de6fc4473
commit be614ad9f8
3 changed files with 14 additions and 10 deletions

View File

@ -307,17 +307,12 @@ void DialogFinalMeasurements::MoveUp()
return;
}
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wstrict-overflow")
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
Move(m_measurements, row, row-1);
#else
m_measurements.move(row, row-1);
#endif
QT_WARNING_POP
UpdateTree();
ui->tableWidget->selectRow(row-1);
@ -333,17 +328,12 @@ void DialogFinalMeasurements::MoveDown()
return;
}
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wstrict-overflow")
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
Move(m_measurements, row, row+1);
#else
m_measurements.move(row, row+1);
#endif
QT_WARNING_POP
UpdateTree();
ui->tableWidget->selectRow(row+1);

View File

@ -29,8 +29,16 @@
#ifndef DIALOGFINALMEASUREMENTS_H
#define DIALOGFINALMEASUREMENTS_H
#include "../vmisc/diagnostic.h"
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wstrict-overflow")
// suppress warning Wstrict-overflow because of method QVector::move()
#include <QDialog>
QT_WARNING_POP
#include "../vmisc/vtablesearch.h"
#include "../vpatterndb/vcontainer.h"
#include "../xml/vpattern.h"

View File

@ -29,6 +29,8 @@
#ifndef DIAGNOSTIC_H
#define DIAGNOSTIC_H
#include <QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
/*
@ -85,6 +87,10 @@
# define QT_WARNING_DISABLE_GCC(text)
#endif
#else
#include <qcompilerdetection.h>
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
#endif // DIAGNOSTIC_H