GNOME Bugzilla – Bug 310938
ext/cairo/gsttimeoverlay.c compile fails on call to rint()
Last modified: 2005-08-29 15:42:47 UTC
Version details: cvs BRANCH-GSTREAMER-0_8 as of 2005-07-19 Distribution/Version: Ubuntu Breezy While compiling gst-plugins using jhbuild, I got the following error: /opt/gnome2/src/gst-plugins/ext/cairo $ make if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../gst-libs -I../../gst-libs -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pthread -I/opt/gnome2/include/gstreamer-0.8 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/opt/gnome2/include/libxml2 -DGST_DISABLE_DEPRECATED -Wall -Werror -D_XOPEN_SOURCE -I/usr/include/freetype2 -I/opt/gnome2/include/cairo -I/opt/gnome2/include -I/usr/include/libpng12 -I../../gst/videofilter -g -O2 -MT libgstcairo_la-gsttimeoverlay.lo -MD -MP -MF ".deps/libgstcairo_la-gsttimeoverlay.Tpo" -c -o libgstcairo_la-gsttimeoverlay.lo `test -f 'gsttimeoverlay.c' || echo './'`gsttimeoverlay.c; \ then mv -f ".deps/libgstcairo_la-gsttimeoverlay.Tpo" ".deps/libgstcairo_la-gsttimeoverlay.Plo"; else rm -f ".deps/libgstcairo_la-gsttimeoverlay.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../gst-libs -I../../gst-libs -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pthread -I/opt/gnome2/include/gstreamer-0.8 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/opt/gnome2/include/libxml2 -DGST_DISABLE_DEPRECATED -Wall -Werror -D_XOPEN_SOURCE -I/usr/include/freetype2 -I/opt/gnome2/include/cairo -I/opt/gnome2/include -I/usr/include/libpng12 -I../../gst/videofilter -g -O2 -MT libgstcairo_la-gsttimeoverlay.lo -MD -MP -MF .deps/libgstcairo_la-gsttimeoverlay.Tpo -c gsttimeoverlay.c -fPIC -DPIC -o .libs/libgstcairo_la-gsttimeoverlay.o cc1: warnings being treated as errors gsttimeoverlay.c: In function 'gst_timeoverlay_print_smpte_time': gsttimeoverlay.c:156: warning: implicit declaration of function 'rint' gsttimeoverlay.c:156: warning: incompatible implicit declaration of built-in function 'rint' make: *** [libgstcairo_la-gsttimeoverlay.lo] Fout 1 After some googling, I bumped into a helpful site: http://ivor.bosloper.nl/2005/05/17/dangerous-gcc-ansi-side-effect/ Modifying Makefile.am to define _GNU_SOURCE seems to have fixed the problem: libgstcairo_la_CFLAGS = $(GST_CFLAGS) $(CAIRO_CFLAGS) \ -I$(top_srcdir)/gst/videofilter -D_GNU_SOURCE
Created attachment 49452 [details] [review] proposed patch (for both _possible_ gcc 4 bugs)
Created attachment 49454 [details] [review] proposed patch Sorry, last one was a bogus patch. I never really meant to attach one, but here's one anyways.
rint() is not a GNU extension, so the patch is wrong.
Am seeing the same, FWIW.
Maybe __USE_XOPEN_EXTENDED or __USE_MISC will do the trick as well? Cheers -Tim
Those are private macros. I think you need #define _XOPEN_SOURCE or _XOPEN_SOURCE_EXTENDED, which are public.
Seems this was a bug in xlibs. For reference: Bug 310903 https://bugs.freedesktop.org/show_bug.cgi?id=3797 https://bugzilla.ubuntu.com/show_bug.cgi?id=12786 (Thanks jamesh!) This seems to be fixed, compile went fine this time around. (Thanks daniels!) Looks like this can be closed...
Fixed here too.