From 18add294721e07ee776387f1520ccf3b0e6c7a5c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 12 Nov 2017 18:48:40 +0100 Subject: [PATCH 1/2] configure.ac: disable -Wnoexcept-type Workaround for #146. --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 1be67c11b..5249044f0 100644 --- a/configure.ac +++ b/configure.ac @@ -1385,6 +1385,11 @@ then AX_APPEND_COMPILE_FLAGS([-Wcast-qual]) AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AX_APPEND_COMPILE_FLAGS([-Wsign-compare]) + + dnl This GCC8 warning for C++17 ABI compatibility is of no + dnl interest for us, because we're not a shared library. + AX_APPEND_COMPILE_FLAGS([-Wno-noexcept-type]) + AC_LANG_POP fi From a2b77c88136788e68824251ac33c0200f2c9cd17 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 12 Nov 2017 18:52:11 +0100 Subject: [PATCH 2/2] decoder/ffmpeg, test/test_protocol: catch exceptions by reference Work around -Werror=catch-value. --- NEWS | 1 + src/decoder/plugins/FfmpegDecoderPlugin.cxx | 2 +- test/test_protocol.cxx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8ff48372b..b89fa5cf6 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.20.12 (not yet released) * input - curl: fix seeking * decoder + - ffmpeg: fix GCC 8 warning - vorbis: fix Tremor support * player - log message when decoder is too slow diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index aba96886d..e154c9852 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -258,7 +258,7 @@ FfmpegSendFrame(DecoderClient &client, InputStream &is, try { output_buffer = copy_interleave_frame(codec_context, frame, buffer); - } catch (const std::exception e) { + } catch (const std::exception &e) { /* this must be a serious error, e.g. OOM */ LogError(e); return DecoderCommand::STOP; diff --git a/test/test_protocol.cxx b/test/test_protocol.cxx index d6c8447e5..38f92fa3e 100644 --- a/test/test_protocol.cxx +++ b/test/test_protocol.cxx @@ -37,7 +37,7 @@ ArgParserTest::TestRange() try { range = ParseCommandArgRange("-2"); CPPUNIT_ASSERT(false); - } catch (ProtocolError) { + } catch (const ProtocolError &) { CPPUNIT_ASSERT(true); } }