[svn-commits] kpfleming: tools/trunk r4845 - /tools/trunk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 27 11:13:25 CDT 2008


Author: kpfleming
Date: Wed Aug 27 11:13:25 2008
New Revision: 4845

URL: http://svn.digium.com/view/dahdi?view=rev&rev=4845
Log:
add --enable-dev-mode support, and fix up a couple of warnings found using it (only two, surprisingly)

Modified:
    tools/trunk/Makefile
    tools/trunk/configure
    tools/trunk/configure.ac
    tools/trunk/dahdi_cfg.c
    tools/trunk/makeopts.in
    tools/trunk/sethdlc.c

Modified: tools/trunk/Makefile
URL: http://svn.digium.com/view/dahdi/tools/trunk/Makefile?view=diff&rev=4845&r1=4844&r2=4845
==============================================================================
--- tools/trunk/Makefile (original)
+++ tools/trunk/Makefile Wed Aug 27 11:13:25 2008
@@ -36,6 +36,10 @@
 endif
 ifneq (,$(findstring x86_64,$(UNAME_M)))
 CFLAGS+=-m64
+endif
+
+ifeq ($(DAHDI_DEVMODE),yes)
+  CFLAGS+=-Werror -Wunused -Wundef $(DAHDI_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
 endif
 
 ROOT_PREFIX=

Modified: tools/trunk/configure.ac
URL: http://svn.digium.com/view/dahdi/tools/trunk/configure.ac?view=diff&rev=4845&r1=4844&r2=4845
==============================================================================
--- tools/trunk/configure.ac (original)
+++ tools/trunk/configure.ac Wed Aug 27 11:13:25 2008
@@ -62,6 +62,25 @@
 AC_SUBST(DOWNLOAD)
 
 AC_LANG(C)
+
+AC_ARG_ENABLE(dev-mode,
+	[  --enable-dev-mode    Turn on developer mode],
+	[case "${enableval}" in
+	      y|ye|yes) DAHDI_DEVMODE=yes ;;
+	      n|no)  DAHDI_DEVMODE=no ;;
+	      *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
+	esac])
+AC_SUBST(DAHDI_DEVMODE)
+
+AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
+if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+	AC_MSG_RESULT(yes)
+	DAHDI_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
+else
+	AC_MSG_RESULT(no)
+	DAHDI_DECLARATION_AFTER_STATEMENT=
+fi
+AC_SUBST(DAHDI_DECLARATION_AFTER_STATEMENT)
 
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])

Modified: tools/trunk/dahdi_cfg.c
URL: http://svn.digium.com/view/dahdi/tools/trunk/dahdi_cfg.c?view=diff&rev=4845&r1=4844&r2=4845
==============================================================================
--- tools/trunk/dahdi_cfg.c (original)
+++ tools/trunk/dahdi_cfg.c Wed Aug 27 11:13:25 2008
@@ -194,6 +194,8 @@
 	deemp = 0;
 	preemp = 0;
 }
+
+static int error(char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
 
 static int error(char *fmt, ...)
 {

Modified: tools/trunk/makeopts.in
URL: http://svn.digium.com/view/dahdi/tools/trunk/makeopts.in?view=diff&rev=4845&r1=4844&r2=4845
==============================================================================
--- tools/trunk/makeopts.in (original)
+++ tools/trunk/makeopts.in Wed Aug 27 11:13:25 2008
@@ -26,6 +26,8 @@
 
 DOWNLOAD=@DOWNLOAD@
 
+DAHDI_DEVMODE=@DAHDI_DEVMODE@
+
 PBX_NEWT=@PBX_NEWT@
 NEWT_LIB=@NEWT_LIB@
 NEWT_INCLUDE=@NEWT_INCLUDE@

Modified: tools/trunk/sethdlc.c
URL: http://svn.digium.com/view/dahdi/tools/trunk/sethdlc.c?view=diff&rev=4845&r1=4844&r2=4845
==============================================================================
--- tools/trunk/sethdlc.c (original)
+++ tools/trunk/sethdlc.c Wed Aug 27 11:13:25 2008
@@ -50,7 +50,7 @@
 int sock;
 
 
-static void error(const char *format, ...) __attribute__ ((noreturn));
+static void error(const char *format, ...) __attribute__ ((noreturn, format(printf, 1, 2)));
 
 static void error(const char *format, ...)
 {




More information about the svn-commits mailing list