telepathy-salut: Update coding style check stuff from telepathy-glib

Simon McVittie smcv at kemper.freedesktop.org
Fri May 3 03:56:20 PDT 2013


Module: telepathy-salut
Branch: master
Commit: dc6a5ddcc684018fd822271b1ee20e5b49d80a24
URL:    http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=dc6a5ddcc684018fd822271b1ee20e5b49d80a24

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Jan  4 11:47:03 2013 +0000

Update coding style check stuff from telepathy-glib

This removes --enable-coding-style-checks in favour of the more general
--enable-fatal-warnings, which also controls use of -Werror (although for
-Werror it can be overridden with --enable-Werror).

---

 configure.ac                |   45 ++++++++++++++++++++++---------------------
 tools/check-c-style.sh      |    7 ------
 tools/check-coding-style.mk |    2 +-
 3 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/configure.ac b/configure.ac
index f07ab52..047b270 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,12 +54,29 @@ AC_MSG_RESULT($platform)
 
 AM_CONDITIONAL([OS_WINDOWS], [test "$platform" = "win32"])
 
-dnl decide error flags
 ifelse(salut_nano_version, 0,
-    [ official_release=yes ],
-    [ official_release=no ])
+[ # version x.y.z - "official release",
+  # disable extra checks by default
+  official_release=yes
+  AC_ARG_ENABLE([fatal-warnings],
+    [AC_HELP_STRING([--enable-fatal-warnings],
+                    [make various warnings fatal])],
+    [],
+    [enable_fatal_warnings=no])
+],
+[ # version x.y.z.1 - development snapshot,
+  # enable extra checks by default
+  official_release=no
+  AC_ARG_ENABLE([fatal-warnings],
+    [AC_HELP_STRING([--disable-fatal-warnings],
+                    [make various warnings non-fatal])],
+    [],
+    [enable_fatal_warnings=yes])
+])
+
+AC_SUBST([enable_fatal_warnings])
 
-TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$official_release" = xno],
+TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$enable_fatal_warnings" = xyes],
   [all \
    extra \
    declaration-after-statement \
@@ -75,26 +92,10 @@ TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$official_release" = xno],
    unused-parameter])
 AC_SUBST([ERROR_CFLAGS])
 
-ifelse(salut_nano_version, 0,
-    [ # Salut is version x.y.z - disable coding style checks by default
-AC_ARG_ENABLE(coding-style-checks,
-  AC_HELP_STRING([--enable-coding-style-checks],
-                 [check coding style using grep]),
-    [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=no] )
-    ],
-    [ # Salut is version x.y.z.1 - enable coding style checks by default
-AC_ARG_ENABLE(coding-style-checks,
-  AC_HELP_STRING([--disable-coding-style-checks],
-                 [do not check coding style using grep]),
-    [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
-    ])
-
 if test x$enable_debug = xyes; then
   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
 fi
 
-AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
-
 dnl Check for code generation tools
 XSLTPROC=
 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
@@ -333,13 +334,13 @@ fi
 prev_ac_configure_args=$ac_configure_args
 ac_configure_args="$ac_configure_args --with-installed-headers=${wocky_install_headers_dir} --enable-shared-suffix=${PACKAGE}-${VERSION} --libdir=${pluginexeclibdir}"
 
-if test "x$ENABLE_CODING_STYLE_CHECKS" = xyes ; then
+if test "x$enable_fatal_warnings" = xyes ; then
   ac_configure_args="$ac_configure_args --enable-coding-style-checks"
 else
   ac_configure_args="$ac_configure_args --disable-coding-style-checks"
 fi
 
-if test "x$tp_werror" = xyes && test "x$official_release" = xno; then
+if test "x$tp_werror" = xyes && test "x$enable_fatal_warnings" = xyes; then
   ac_configure_args="$ac_configure_args --enable-Werror"
 else
   ac_configure_args="$ac_configure_args --disable-Werror"
diff --git a/tools/check-c-style.sh b/tools/check-c-style.sh
index 4330b14..5583420 100644
--- a/tools/check-c-style.sh
+++ b/tools/check-c-style.sh
@@ -3,13 +3,6 @@ fail=0
 
 ( . "${tools_dir}"/check-misc.sh ) || fail=$?
 
-if grep -n '^ *GError *\*[[:alpha:]_][[:alnum:]_]* *;' "$@"
-then
-  echo "^^^ The above files contain uninitialized GError*s - they should be"
-  echo "    initialized to NULL"
-  fail=1
-fi
-
 # The first regex finds function calls like foo() (as opposed to foo ()).
 #   It attempts to ignore string constants (may cause false negatives).
 # The second and third ignore block comments (gtkdoc uses foo() as markup).
diff --git a/tools/check-coding-style.mk b/tools/check-coding-style.mk
index 1c0a60f..f3f74fa 100644
--- a/tools/check-coding-style.mk
+++ b/tools/check-coding-style.mk
@@ -10,7 +10,7 @@ check-coding-style:
 		sh $(top_srcdir)/tools/check-c-style.sh \
 			$(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \
 	fi;\
-	if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \
+	if test yes = "$(enable_fatal_warnings)"; then \
 		exit "$$fail";\
 	else \
 		exit 0;\



More information about the telepathy-commits mailing list