In strstr-like code the warning should be disabled.
---
 configure            | 5 +++++
 libavutil/internal.h | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/configure b/configure
index dfbda66..6860004 100755
--- a/configure
+++ b/configure
@@ -1585,6 +1585,7 @@ TOOLCHAIN_FEATURES="
     ibm_asm
     inline_asm_labels
     pragma_deprecated
+    pragma_incompatible_pointer_types
     symver_asm_label
     symver_gnu_asm
     vfp_args
@@ -4029,6 +4030,10 @@ check_cc <<EOF && enable pragma_deprecated
 void foo(void) { _Pragma("GCC diagnostic ignored 
\"-Wdeprecated-declarations\"") }
 EOF
 
+check_cc <<EOF && enable pragma_incompatible_pointer_types
+void foo(void) { _Pragma("GCC diagnostic ignored 
\"-Wincompatible-pointer-types 
-Wincompatible-pointer-types-discards-qualifiers\"") }
+EOF
+
 check_cc <<EOF && enable attribute_packed
 struct { int x; } __attribute__((packed)) x;
 EOF
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 4264c4e..bb12727 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -77,6 +77,14 @@
 #    define FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
+#if HAVE_PRAGMA_INCOMPATIBLE_POINTER_TYPES
+#   define FF_DISABLE_POINTER_TYPES_WARNINGS _Pragma("GCC diagnostic ignored 
\"-Wincompatible-pointer-types\"")
+#   define FF_ENABLE_POINTER_TYPES_WARNINGS  _Pragma("GCC diagnostic warning 
\"-Wincompatible-pointer-types\"")
+#else
+#   define FF_DISABLE_POINTER_TYPES_WARNINGS
+#   define FF_ENABLE_POINTER_TYPES_WARNINGS
+#endif
+
 // Some broken preprocessors need a second expansion
 // to be forced to tokenize __VA_ARGS__
 #define E1(x) x
-- 
2.6.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to