aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio_parser.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-06-12 19:21:53 +0200
committerMax Kellermann <max@duempel.org>2012-06-12 19:31:19 +0200
commit055257a210015a623062ad3ad3cb8a40fbc6839f (patch)
treec2e9f0562dc9c6d9719921f3851b52dd4cc2fc87 /src/audio_parser.c
parent50cfb997ccbbebd6387f2f2cfbc3279d8426020f (diff)
downloadmpd-055257a210015a623062ad3ad3cb8a40fbc6839f.tar.gz
mpd-055257a210015a623062ad3ad3cb8a40fbc6839f.tar.xz
mpd-055257a210015a623062ad3ad3cb8a40fbc6839f.zip
audio-parser, output_thread: work around -Wmaybe-uninitialized
False positives in gcc 4.7.
Diffstat (limited to '')
-rw-r--r--src/audio_parser.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/audio_parser.c b/src/audio_parser.c
index 139cf1c04..908230cb2 100644
--- a/src/audio_parser.c
+++ b/src/audio_parser.c
@@ -26,6 +26,7 @@
#include "audio_parser.h"
#include "audio_format.h"
#include "audio_check.h"
+#include "gcc.h"
#include <assert.h>
#include <string.h>
@@ -160,6 +161,11 @@ audio_format_parse(struct audio_format *dest, const char *src,
/* parse sample rate */
+#if GCC_CHECK_VERSION(4,7)
+ /* workaround -Wmaybe-uninitialized false positive */
+ rate = 0;
+#endif
+
if (!parse_sample_rate(src, mask, &rate, &src, error_r))
return false;
@@ -171,6 +177,11 @@ audio_format_parse(struct audio_format *dest, const char *src,
/* parse sample format */
+#if GCC_CHECK_VERSION(4,7)
+ /* workaround -Wmaybe-uninitialized false positive */
+ sample_format = SAMPLE_FORMAT_UNDEFINED;
+#endif
+
if (!parse_sample_format(src, mask, &sample_format, &src, error_r))
return false;