[FFmpeg-devel] [PATCH 8/8] libavutil/opt.c: fix build warning

Guo, Yejun yejun.guo at intel.com
Sat Feb 20 09:22:18 EET 2021


src/libavutil/opt.c: In function ‘av_opt_child_class_iterate’:
src/libavutil/opt.c:1738:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         *iter = parent->child_class_next(*iter);
               ^
---
This patch set fixes build warnings during make on my system
with gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
with config option:
--disable-optimizations --enable-libx264 --enable-libx265 --enable-gpl --enable-libvpx --enable-libmfx --extra-cflags="-Wno-deprecated-declarations"

I also tried '-Wall -Werror', there are many many issues starting from
configure. It is a long term task, let's fix one by one when have time.


 libavutil/opt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 590146b5fb..c47146c47f 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1735,7 +1735,7 @@ const AVClass *av_opt_child_class_iterate(const AVClass *parent, void **iter)
 #if FF_API_CHILD_CLASS_NEXT
 FF_DISABLE_DEPRECATION_WARNINGS
     if (parent->child_class_next) {
-        *iter = parent->child_class_next(*iter);
+        *iter = (void *)parent->child_class_next(*iter);
         return *iter;
     }
 FF_ENABLE_DEPRECATION_WARNINGS
-- 
2.17.1



More information about the ffmpeg-devel mailing list