GNOME Bugzilla – Bug 572185
[v4l2src] "function sort_by_frame_size defined but not used" on rhel/centos-5
Last modified: 2009-08-10 23:16:54 UTC
Please describe the problem: since -Werror defined during compilation of gstreamer-plugins-good-0.10.13.2 i've got the error bellow. the reason is that in sys/v4l2/v4l2src_calls.c the function sort_by_frame_size defined even it's not used (because VIDIOC_ENUM_FRAMESIZES is not defined) it's a warning but as -Werror defined it's a compile time error: --------------------------------------------------- libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I../../gst-libs -I../../gst-libs -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -Wall -Wdeclaration-after-statement -Werror -fno-strict-aliasing -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -MT libgstvideo4linux2_la-v4l2src_calls.lo -MD -MP -MF .deps/libgstvideo4linux2_la-v4l2src_calls.Tpo -c v4l2src_calls.c -fPIC -DPIC -o .libs/libgstvideo4linux2_la-v4l2src_calls.o cc1: warnings being treated as errors v4l2src_calls.c:776: warning: 'sort_by_frame_size' defined but not used make[3]: *** [libgstvideo4linux2_la-v4l2src_calls.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... mv -f .deps/libgstvideo4linux2_la-v4l2_calls.Tpo .deps/libgstvideo4linux2_la-v4l2_calls.Plo make[3]: Leaving directory `/home/lfarkas/rpm/BUILD/gst-plugins-good-0.10.13.2/sys/v4l2' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/lfarkas/rpm/BUILD/gst-plugins-good-0.10.13.2/sys' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/lfarkas/rpm/BUILD/gst-plugins-good-0.10.13.2' make: *** [all] Error 2 --------------------------------------------------- a simple patch can be: ------------------------------------------------ --- ./sys/v4l2/v4l2src_calls.c.lfarkas 2009-02-17 19:00:22.000000000 +0100 +++ ./sys/v4l2/v4l2src_calls.c 2009-02-17 19:09:55.000000000 +0100 @@ -771,6 +771,7 @@ } #endif /* defined VIDIOC_ENUM_FRAMEINTERVALS */ +#ifdef VIDIOC_ENUM_FRAMESIZES static gint sort_by_frame_size (GstStructure * s1, GstStructure * s2) { @@ -784,6 +785,7 @@ /* I think it's safe to assume that this won't overflow for a while */ return ((w2 * h2) - (w1 * h1)); } +#endif /* defined VIDIOC_ENUM_FRAMESIZES */ GstCaps * gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat, ------------------------------------------------ Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 128917 [details] [review] v4l2src: make sort by frame conditionally compiled
I don't think this is worth blocking the release for at this stage - the release tarballs don't use -Werror, so it won't stop the compilation there. The tarball is due out tomorrow, but would have to be delayed for a new pre-release to include this, and we (Tim & I) already left out one patch for a compile warning.
works for me.
commit d2fc4cb3ba7711170d5f4d1a9f080496b3268b87 Author: Levente Farkas <lfarkas@lfarkas.org> Date: Tue Feb 17 11:01:47 2009 -0800 v4l2src: Make sort_by_frame_size conditionally compiled sort_by_frame_size is declared static and only used inside an ifdef, so use the same ifdef to define the function. Fixes #572185 Signed-off-by: David Schleef <ds@schleef.org>