From f627c78fa6c7e4faddf24110b54d9ec01688ccce Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 8 Jul 2005 14:01:31 +0000 Subject: [PATCH] configure.ac: make GST_ERROR_CFLAGS overridable and re-enable Werror Original commit message from CVS: * configure.ac: make GST_ERROR_CFLAGS overridable and re-enable Werror * docs/faq/cvs.xml: add a note about error CFLAGS * docs/gst/tmpl/gstfakesrc.sgml: * gst/elements/gstfakesrc.c: comment out some unused code * gst/gst.c: (split_and_iterate): * gst/registries/gstlibxmlregistry.c: (load_pad_template), (load_feature): plug some memleaks --- ChangeLog | 14 ++++++++++++++ common | 2 +- configure.ac | 11 ++++++----- docs/faq/cvs.xml | 29 +++++++++++++++++++++++++++++ docs/gst/tmpl/gstfakesrc.sgml | 10 ---------- gst/elements/gstfakesrc.c | 2 ++ gst/gst.c | 1 + gst/registries/gstlibxmlregistry.c | 10 +++++++--- plugins/elements/gstfakesrc.c | 2 ++ 9 files changed, 62 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7f1a0c..95fbfe2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2005-07-08 Thomas Vander Stichele + + * configure.ac: + make GST_ERROR_CFLAGS overridable and re-enable Werror + * docs/faq/cvs.xml: + add a note about error CFLAGS + * docs/gst/tmpl/gstfakesrc.sgml: + * gst/elements/gstfakesrc.c: + comment out some unused code + * gst/gst.c: (split_and_iterate): + * gst/registries/gstlibxmlregistry.c: (load_pad_template), + (load_feature): + plug some memleaks + 2005-07-07 Thomas Vander Stichele * common/Makefile.am: diff --git a/common b/common index c40d6ab..221ac8a 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit c40d6ab2d62f885c52650db2438e099d3f369f8f +Subproject commit 221ac8abacb46858382a9f8c924152ae588f4a2e diff --git a/configure.ac b/configure.ac index 346eeb4..224613b 100644 --- a/configure.ac +++ b/configure.ac @@ -62,10 +62,11 @@ AS_COMPILER_FLAG(-Wall, GST_ERROR_CFLAGS="-Wall", GST_ERROR_CFLAGS="") dnl if we're in nano >= 1, add -Werror if supported -dnl if test "x$GST_CVS" = "xyes" -dnl then -dnl AS_COMPILER_FLAG(-Werror, GST_ERROR_CFLAGS="$GST_ERROR_CFLAGS -Werror") -dnl fi +if test "x$GST_CVS" = "xyes" +then + AS_COMPILER_FLAG(-Werror, GST_ERROR_CFLAGS="$GST_ERROR_CFLAGS -Werror") +fi +AC_SUBST(GST_ERROR_CFLAGS) dnl We disable static building for development, for time savings dnl *NOTE*: dnl this line before release, so release does static too @@ -588,7 +589,7 @@ dnl we disable deprecated internally dnl XML, GLib, popt, GST_INT, VALGRIND, and the right include for CFLAGS dnl no need to add XML, GLib, popt explicitly since libgstreamer pulls them in GST_INT_CFLAGS="$GLIB_CFLAGS $XML_CFLAGS $GST_PKG_CFLAGS \ - $GST_INT_CFLAGS $GST_ERROR_CFLAGS -DGST_DISABLE_DEPRECATED" + $GST_INT_CFLAGS \$(GST_ERROR_CFLAGS) -DGST_DISABLE_DEPRECATED" dnl Private vars for libgst only GST_LIB_CFLAGS="$GST_PKG_CFLAGS $GST_INT_CFLAGS \ diff --git a/docs/faq/cvs.xml b/docs/faq/cvs.xml index 5c29912..a424e3b 100644 --- a/docs/faq/cvs.xml +++ b/docs/faq/cvs.xml @@ -102,5 +102,34 @@ where you replace prefix with the prefix where libtool was installed. + + + + +Why is "-Wall -Werror" being used ? + + + + + +"-Wall" is being used because it finds a lot of possible problems with code. +Not all of them are necessarily a problem, but it's better to have the compiler +report some false positives and find a work-around than to spend time +chasing a bug for days that the compiler was giving you hints about. + + +"-Werror" is turned off for actual releases. It's turned on by default for +CVS and prereleases so that people actually notice and fix problems found by +"-Wall". We want people to actively hit and report or fix them. + + +If for any reason you want to bypass these flags and you are certain it's the +right thing to do, you can run +make GST_ERROR_CFLAGS=" +to clear the CFLAGS for error checking. + + + + diff --git a/docs/gst/tmpl/gstfakesrc.sgml b/docs/gst/tmpl/gstfakesrc.sgml index d67c381..ad368cf 100644 --- a/docs/gst/tmpl/gstfakesrc.sgml +++ b/docs/gst/tmpl/gstfakesrc.sgml @@ -43,11 +43,6 @@ GstFakeSrc - - - - - @@ -78,11 +73,6 @@ GstFakeSrc - - - - - diff --git a/gst/elements/gstfakesrc.c b/gst/elements/gstfakesrc.c index 8bddf81..0d44076 100644 --- a/gst/elements/gstfakesrc.c +++ b/gst/elements/gstfakesrc.c @@ -94,6 +94,7 @@ enum PROP_IS_LIVE }; +/* not implemented #define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type()) static GType gst_fakesrc_output_get_type (void) @@ -117,6 +118,7 @@ gst_fakesrc_output_get_type (void) } return fakesrc_output_type; } +*/ #define GST_TYPE_FAKESRC_DATA (gst_fakesrc_data_get_type()) static GType diff --git a/gst/gst.c b/gst/gst.c index 6411c7e..7c3e496 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -448,6 +448,7 @@ split_and_iterate (const gchar * stringlist, gchar * separator, GFunc iterator, break; } } + g_strfreev (strings); } } diff --git a/gst/registries/gstlibxmlregistry.c b/gst/registries/gstlibxmlregistry.c index f2f4d56..dfe68e2 100644 --- a/gst/registries/gstlibxmlregistry.c +++ b/gst/registries/gstlibxmlregistry.c @@ -661,6 +661,8 @@ load_pad_template (xmlTextReaderPtr reader) guint direction = 0, presence = 0; while ((ret = xmlTextReaderRead (reader)) == 1) { + /* if we're back at our depth, we have all info, and can return + * the completely parsed template */ if (xmlTextReaderDepth (reader) == depth) { GstStaticPadTemplate *template; @@ -684,6 +686,7 @@ load_pad_template (xmlTextReaderPtr reader) read_enum (reader, GST_TYPE_PAD_PRESENCE, &presence); } else if (!strncmp (tag, "caps", 4)) { read_string (reader, &caps_str); + g_print ("THOMAS: read caps string %s\n", caps_str); } } } @@ -698,14 +701,15 @@ load_feature (xmlTextReaderPtr reader) { int ret; int depth = xmlTextReaderDepth (reader); - const gchar *feature_name = - (const gchar *) xmlTextReaderGetAttribute (reader, BAD_CAST "typename"); + xmlChar *feature_name = + xmlTextReaderGetAttribute (reader, BAD_CAST "typename"); GstPluginFeature *feature; GType type; if (!feature_name) return NULL; - type = g_type_from_name (feature_name); + type = g_type_from_name ((gchar *) feature_name); + xmlFree (feature_name); if (!type) return NULL; feature = g_object_new (type, NULL); diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 8bddf81..0d44076 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -94,6 +94,7 @@ enum PROP_IS_LIVE }; +/* not implemented #define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type()) static GType gst_fakesrc_output_get_type (void) @@ -117,6 +118,7 @@ gst_fakesrc_output_get_type (void) } return fakesrc_output_type; } +*/ #define GST_TYPE_FAKESRC_DATA (gst_fakesrc_data_get_type()) static GType -- 2.7.4