[partition] Reduce warnings

- Add a helper header that munges the warnings-settings so that
  KPMcore headers can be included.
This commit is contained in:
Adriaan de Groot 2020-11-01 00:05:05 +01:00
parent c41ff94f8a
commit d26fde6647
2 changed files with 37 additions and 3 deletions

View File

@ -0,0 +1,36 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
/*
* KPMCore header file inclusion.
*
* Includes the system KPMCore headers without warnings (by switching off
* the expected warnings).
*/
#ifndef PARTITION_KPMHELPER_H
#define PARTITION_KPMHELPER_H
// The kpmcore headers are not C++17 warning-proof, especially
// with picky compilers like Clang 10. Since we use Clang for the
// find-all-the-warnings case, switch those warnings off for
// the we-can't-change-them system headers.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wsuggest-destructor-override"
#endif
#include <backend/corebackend.h>
#include <fs/filesystemfactory.h>
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif

View File

@ -15,14 +15,12 @@
#include "jobs/CreatePartitionTableJob.h" #include "jobs/CreatePartitionTableJob.h"
#include "jobs/ResizePartitionJob.h" #include "jobs/ResizePartitionJob.h"
#include "partition/KPMHelper.h"
#include "partition/KPMManager.h" #include "partition/KPMManager.h"
#include "partition/PartitionQuery.h" #include "partition/PartitionQuery.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/Units.h" #include "utils/Units.h"
#include <backend/corebackend.h>
#include <fs/filesystemfactory.h>
#include <QEventLoop> #include <QEventLoop>
#include <QProcess> #include <QProcess>
#include <QtTest/QtTest> #include <QtTest/QtTest>