aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-08-27 08:26:01 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-08-27 08:31:45 +0200
commit19364c0ddf227874b7b0df0ea1b240f082d60e23 (patch)
treec4d22d3f831a33d300a39c569890ad6818dcc5a0 /src
parentadccbb380b2ee8abbc2f337cd69b4f13cd763602 (diff)
parentb367745cfe19f6de3f44b3adc90fa08e36e44bb6 (diff)
downloadbitcoin-19364c0ddf227874b7b0df0ea1b240f082d60e23.tar.xz
Merge bitcoin/bitcoin#20586: Fix Windows build with --enable-werror
b367745cfe19f6de3f44b3adc90fa08e36e44bb6 ci: Make Cirrus CI Windows build with --enable-werror (Hennadii Stepanov) c713bb2b243881a771ab288340ffeb623c82d7f6 Fix Windows build with --enable-werror on Ubuntu Focal (Hennadii Stepanov) Pull request description: This PR makes possible to cross-compile Windows build with `--enable-werror --enable-suppress-external-warnings`. Some problems are fixed, others are silenced. Also `--enable-werror` is enabled for Cirrus CI Windows build (the last one on Cirrus CI without `--enable-werror`). ACKs for top commit: practicalswift: cr ACK b367745cfe19f6de3f44b3adc90fa08e36e44bb6: patch looks correct laanwj: Code review ACK b367745cfe19f6de3f44b3adc90fa08e36e44bb6 vasild: ACK b367745cfe19f6de3f44b3adc90fa08e36e44bb6 jarolrod: ACK b367745cfe19f6de3f44b3adc90fa08e36e44bb6 Tree-SHA512: 64f5c99b7dad4c0efce80cd45d7074f275bd8411235dc9e0841287bdab64b812c6f8f9d632c35531d0b8210148531f53aaaac77be7699b29d2d6aaae304dbee0
Diffstat (limited to 'src')
-rw-r--r--src/fs.cpp8
-rw-r--r--src/qt/winshutdownmonitor.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/fs.cpp b/src/fs.cpp
index 89c7ad27dc..b9b3c46d8d 100644
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -154,7 +154,10 @@ std::string get_filesystem_error_message(const fs::filesystem_error& e)
#ifdef __GLIBCXX__
// reference: https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/libstdc%2B%2B-v3/include/std/fstream#L270
-
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wswitch"
+#endif
static std::string openmodeToStr(std::ios_base::openmode mode)
{
switch (mode & ~std::ios_base::ate) {
@@ -192,6 +195,9 @@ static std::string openmodeToStr(std::ios_base::openmode mode)
return std::string();
}
}
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
void ifstream::open(const fs::path& p, std::ios_base::openmode mode)
{
diff --git a/src/qt/winshutdownmonitor.h b/src/qt/winshutdownmonitor.h
index 8edb98c744..bf399edcf3 100644
--- a/src/qt/winshutdownmonitor.h
+++ b/src/qt/winshutdownmonitor.h
@@ -17,7 +17,7 @@ class WinShutdownMonitor : public QAbstractNativeEventFilter
{
public:
/** Implements QAbstractNativeEventFilter interface for processing Windows messages */
- bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult);
+ bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult) override;
/** Register the reason for blocking shutdown on Windows to allow clean client exit */
static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);