From fe1b49262960882694b9da55d7b2054c4d4d4fdb Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 26 Aug 2017 11:50:31 +0200
Subject: gcc2 fixes


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bcb107..d20871a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,11 +33,11 @@ find_package(Iconv)
 set(HAVE_ICONV ${Iconv_FOUND})
 
 if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline")
     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -funroll-loops")
 endif()
 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef")
 endif()
 
 include(CMakePackageConfigHelpers)
diff --git a/include/FLAC++/decoder.h b/include/FLAC++/decoder.h
index 6a2d901..56dd1c8 100644
--- a/include/FLAC++/decoder.h
+++ b/include/FLAC++/decoder.h
@@ -225,11 +225,15 @@ namespace FLAC {
 			File();
 			virtual ~File();
 
+#if __GNUC__ > 2
 			using Stream::init;
+#endif
 			virtual ::FLAC__StreamDecoderInitStatus init(FILE *file);                      ///< See FLAC__stream_decoder_init_FILE()
 			virtual ::FLAC__StreamDecoderInitStatus init(const char *filename);            ///< See FLAC__stream_decoder_init_file()
 			virtual ::FLAC__StreamDecoderInitStatus init(const std::string &filename);     ///< See FLAC__stream_decoder_init_file()
+#if __GNUC__ > 2
 			using Stream::init_ogg;
+#endif
 			virtual ::FLAC__StreamDecoderInitStatus init_ogg(FILE *file);                  ///< See FLAC__stream_decoder_init_ogg_FILE()
 			virtual ::FLAC__StreamDecoderInitStatus init_ogg(const char *filename);        ///< See FLAC__stream_decoder_init_ogg_file()
 			virtual ::FLAC__StreamDecoderInitStatus init_ogg(const std::string &filename); ///< See FLAC__stream_decoder_init_ogg_file()
diff --git a/include/FLAC++/encoder.h b/include/FLAC++/encoder.h
index ce8d80a..fd40f0b 100644
--- a/include/FLAC++/encoder.h
+++ b/include/FLAC++/encoder.h
@@ -235,11 +235,15 @@ namespace FLAC {
 			File();
 			virtual ~File();
 
+#if __GNUC__ > 2
 			using Stream::init;
+#endif
 			virtual ::FLAC__StreamEncoderInitStatus init(FILE *file);                      ///< See FLAC__stream_encoder_init_FILE()
 			virtual ::FLAC__StreamEncoderInitStatus init(const char *filename);            ///< See FLAC__stream_encoder_init_file()
 			virtual ::FLAC__StreamEncoderInitStatus init(const std::string &filename);     ///< See FLAC__stream_encoder_init_file()
+#if __GNUC__ > 2
 			using Stream::init_ogg;
+#endif
 			virtual ::FLAC__StreamEncoderInitStatus init_ogg(FILE *file);                  ///< See FLAC__stream_encoder_init_ogg_FILE()
 			virtual ::FLAC__StreamEncoderInitStatus init_ogg(const char *filename);        ///< See FLAC__stream_encoder_init_ogg_file()
 			virtual ::FLAC__StreamEncoderInitStatus init_ogg(const std::string &filename); ///< See FLAC__stream_encoder_init_ogg_file()
diff --git a/src/libFLAC++/metadata.cpp b/src/libFLAC++/metadata.cpp
index 374e5b3..169f5b8 100644
--- a/src/libFLAC++/metadata.cpp
+++ b/src/libFLAC++/metadata.cpp
@@ -827,7 +827,7 @@ namespace FLAC {
 			clear_field_name();
 			clear_field_value();
 
-			const char *p = static_cast<const char *>(std::memchr(entry_.entry, '=', entry_.length));
+			const char *p = (const char *)(std::memchr(entry_.entry, '=', entry_.length));
 
 			if(0 == p)
 				p = reinterpret_cast<const char *>(entry_.entry) + entry_.length;
-- 
2.30.2

