[asterisk-commits] kpfleming: branch 1.6.0 r159855 - in /branches/1.6.0: ./ cdr/ channels/ chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Nov 29 12:37:56 CST 2008


Author: kpfleming
Date: Sat Nov 29 12:37:55 2008
New Revision: 159855

URL: http://svn.digium.com/view/asterisk?view=rev&rev=159855
Log:
Merged revisions 159818 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r159818 | kpfleming | 2008-11-29 11:57:39 -0600 (Sat, 29 Nov 2008) | 18 lines
  
  incorporates r159808 from branches/1.4:
  ------------------------------------------------------------------------
  r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines
  
  update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors
  
  since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them
  
  format attributes in a consistent way
  
  
  ------------------------------------------------------------------------
  
  in addition:
  
  move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/Makefile
    branches/1.6.0/cdr/cdr_tds.c
    branches/1.6.0/channels/chan_agent.c
    branches/1.6.0/channels/chan_misdn.c
    branches/1.6.0/channels/chan_sip.c
    branches/1.6.0/channels/chan_vpb.cc
    branches/1.6.0/channels/misdn/ie.c
    branches/1.6.0/channels/misdn_config.c
    branches/1.6.0/configure
    branches/1.6.0/configure.ac
    branches/1.6.0/funcs/Makefile
    branches/1.6.0/include/asterisk/astmm.h
    branches/1.6.0/include/asterisk/channel.h
    branches/1.6.0/include/asterisk/cli.h
    branches/1.6.0/include/asterisk/compat.h
    branches/1.6.0/include/asterisk/devicestate.h
    branches/1.6.0/include/asterisk/dundi.h
    branches/1.6.0/include/asterisk/enum.h
    branches/1.6.0/include/asterisk/linkedlists.h
    branches/1.6.0/include/asterisk/logger.h
    branches/1.6.0/include/asterisk/manager.h
    branches/1.6.0/include/asterisk/module.h
    branches/1.6.0/include/asterisk/res_odbc.h
    branches/1.6.0/include/asterisk/stringfields.h
    branches/1.6.0/include/asterisk/strings.h
    branches/1.6.0/include/asterisk/utils.h
    branches/1.6.0/include/jitterbuf.h
    branches/1.6.0/main/Makefile
    branches/1.6.0/main/ast_expr2.c
    branches/1.6.0/main/dns.c
    branches/1.6.0/main/event.c
    branches/1.6.0/main/features.c
    branches/1.6.0/main/srv.c
    branches/1.6.0/main/utils.c
    branches/1.6.0/makeopts.in
    branches/1.6.0/res/res_config_sqlite.c
    branches/1.6.0/utils/astman.c
    branches/1.6.0/utils/check_expr.c
    branches/1.6.0/utils/conf2ael.c
    branches/1.6.0/utils/extconf.c
    branches/1.6.0/utils/frame.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/Makefile?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/Makefile (original)
+++ branches/1.6.0/Makefile Sat Nov 29 12:37:55 2008
@@ -228,7 +228,13 @@
 ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
 
 ifeq ($(AST_DEVMODE),yes)
-  ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
+  ASTCFLAGS+=-Werror
+  ASTCFLAGS+=-Wunused
+  ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
+  ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
+  ASTCFLAGS+=-Wundef 
+  ASTCFLAGS+=-Wmissing-format-attribute
+  ASTCFLAGS+=-Wformat=2
 endif
 
 ifneq ($(findstring BSD,$(OSARCH)),)

Modified: branches/1.6.0/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/cdr/cdr_tds.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/cdr/cdr_tds.c (original)
+++ branches/1.6.0/cdr/cdr_tds.c Sat Nov 29 12:37:55 2008
@@ -103,7 +103,7 @@
 static void get_date(char *, size_t len, struct timeval);
 
 static int execute_and_consume(DBPROCESS *dbproc, const char *fmt, ...)
-	__attribute__ ((format (printf, 2, 3)));
+	__attribute__((format(printf, 2, 3)));
 
 static int mssql_connect(void);
 static int mssql_disconnect(void);

Modified: branches/1.6.0/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_agent.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/channels/chan_agent.c (original)
+++ branches/1.6.0/channels/chan_agent.c Sat Nov 29 12:37:55 2008
@@ -1012,7 +1012,7 @@
 	}
 #endif	
 	if (p->pending)
-		tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", 0, "Agent/P%s-%d", p->agent, ast_random() & 0xffff);
+		tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", 0, "Agent/P%s-%d", p->agent, (int) ast_random() & 0xffff);
 	else
 		tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", 0, "Agent/%s", p->agent);
 	if (!tmp) {

Modified: branches/1.6.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_misdn.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/channels/chan_misdn.c (original)
+++ branches/1.6.0/channels/chan_misdn.c Sat Nov 29 12:37:55 2008
@@ -285,7 +285,7 @@
 static int *misdn_ports;
 
 static void chan_misdn_log(int level, int port, char *tmpl, ...)
-	__attribute__ ((format (printf, 3, 4)));
+	__attribute__((format(printf, 3, 4)));
 
 static struct ast_channel *misdn_new(struct chan_list *cl, int state,  char *exten, char *callerid, int format, int port, int c);
 static void send_digit_to_chan(struct chan_list *cl, char digit );

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Sat Nov 29 12:37:55 2008
@@ -2331,7 +2331,7 @@
 };
 
 static void append_history_full(struct sip_pvt *p, const char *fmt, ...)
-	__attribute__ ((format (printf, 2, 3)));
+	__attribute__((format(printf, 2, 3)));
 
 
 /*! \brief Convert transfer status to string */
@@ -2628,9 +2628,9 @@
 
 	/* z9hG4bK is a magic cookie.  See RFC 3261 section 8.1.1.7 */
 	ast_string_field_build(p, via, "SIP/2.0/%s %s:%d;branch=z9hG4bK%08x%s",
-			get_transport_pvt(p),
-			ast_inet_ntoa(p->ourip.sin_addr),
-			ntohs(p->ourip.sin_port), p->branch, rport);
+			       get_transport_pvt(p),
+			       ast_inet_ntoa(p->ourip.sin_addr),
+			       ntohs(p->ourip.sin_port), (int) p->branch, rport);
 }
 
 /*! \brief NAT fix - decide which IP address to use for Asterisk server?
@@ -2691,7 +2691,7 @@
 }
 
 /*! \brief Append to SIP dialog history with arg list  */
-static __attribute__((format (printf, 2, 0))) void append_history_va(struct sip_pvt *p, const char *fmt, va_list ap)
+static __attribute__((format(printf, 2, 0))) void append_history_va(struct sip_pvt *p, const char *fmt, va_list ap)
 {
 	char buf[80], *c = buf; /* max history length */
 	struct sip_history *hist;

Modified: branches/1.6.0/channels/chan_vpb.cc
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_vpb.cc?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/channels/chan_vpb.cc (original)
+++ branches/1.6.0/channels/chan_vpb.cc Sat Nov 29 12:37:55 2008
@@ -2486,7 +2486,7 @@
 	}
 	ast_verb(4, "%s: New call for context [%s]\n", me->dev, context);
 	    
-	tmp = ast_channel_alloc(1, state, 0, 0, "", me->ext, me->context, 0, me->dev);
+	tmp = ast_channel_alloc(1, state, 0, 0, "", me->ext, me->context, 0, "%s", me->dev);
 	if (tmp) {
 		if (use_ast_ind == 1){
 			tmp->tech = &vpb_tech_indicate;

Modified: branches/1.6.0/channels/misdn/ie.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/misdn/ie.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/channels/misdn/ie.c (original)
+++ branches/1.6.0/channels/misdn/ie.c Sat Nov 29 12:37:55 2008
@@ -1347,7 +1347,7 @@
 	i = 0;
 	while(i < user_len)
 	{
-		if (MISDN_IE_DEBG) printf(debug+(i*3), " %02x", user[i]);
+		if (MISDN_IE_DEBG) sprintf(debug+(i*3), " %02x", user[i]);
 		i++;
 	}
 		
@@ -1393,7 +1393,7 @@
 	i = 0;
 	while(i < *user_len)
 	{
-		if (MISDN_IE_DEBG) printf(debug+(i*3), " %02x", user[i]);
+		if (MISDN_IE_DEBG) sprintf(debug+(i*3), " %02x", user[i]);
 		i++;
 	}
 	debug[i*3] = '\0';

Modified: branches/1.6.0/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/misdn_config.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/channels/misdn_config.c (original)
+++ branches/1.6.0/channels/misdn_config.c Sat Nov 29 12:37:55 2008
@@ -885,12 +885,14 @@
 		break;
 	case MISDN_CTYPE_INT:
 	{
-		char *pat;
-		if (strchr(value,'x')) 
-			pat="%x";
-		else
-			pat="%d";
-		if (sscanf(value, pat, &tmp)) {
+		int res;
+
+		if (strchr(value,'x')) {
+			res = sscanf(value, "%x", &tmp);
+		} else {
+			res = sscanf(value, "%d", &tmp);
+		}
+		if (res) {
 			dest->num = ast_malloc(sizeof(int));
 			memcpy(dest->num, &tmp, sizeof(int));
 		} else

Modified: branches/1.6.0/configure.ac
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/configure.ac?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/configure.ac (original)
+++ branches/1.6.0/configure.ac Sat Nov 29 12:37:55 2008
@@ -491,6 +491,16 @@
 	AST_DECLARATION_AFTER_STATEMENT=
 fi
 AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
+
+AC_MSG_CHECKING(for _FORTIFY_SOURCE support)
+if $(${CC} -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+	AC_MSG_RESULT(yes)
+	AST_FORTIFY_SOURCE=-D_FORTIFY_SOURCE=2
+else
+	AC_MSG_RESULT(no)
+	AST_FORTIFY_SOURCE=
+fi
+AC_SUBST(AST_FORTIFY_SOURCE)
 
 AC_MSG_CHECKING(for -fno-strict-overflow)
 if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then

Modified: branches/1.6.0/funcs/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/funcs/Makefile?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/funcs/Makefile (original)
+++ branches/1.6.0/funcs/Makefile Sat Nov 29 12:37:55 2008
@@ -18,3 +18,5 @@
 all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
+
+func_strings.o: ASTCFLAGS+=-Wno-format-nonliteral

Modified: branches/1.6.0/include/asterisk/astmm.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/astmm.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/astmm.h (original)
+++ branches/1.6.0/include/asterisk/astmm.h Sat Nov 29 12:37:55 2008
@@ -51,9 +51,9 @@
 char *__ast_strdup(const char *s, const char *file, int lineno, const char *func);
 char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const char *func);
 int __ast_asprintf(const char *file, int lineno, const char *func, char **strp, const char *format, ...)
-	__attribute__ ((format (printf, 5, 6)));
+	__attribute__((format(printf, 5, 6)));
 int __ast_vasprintf(char **strp, const char *format, va_list ap, const char *file, int lineno, const char *func)
-	__attribute__ ((format (printf, 2, 0)));
+	__attribute__((format(printf, 2, 0)));
 void __ast_mm_init(void);
 
 

Modified: branches/1.6.0/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/channel.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/channel.h (original)
+++ branches/1.6.0/include/asterisk/channel.h Sat Nov 29 12:37:55 2008
@@ -727,7 +727,7 @@
  * \note By default, new channels are set to the "s" extension
  *       and "default" context.
  */
-struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const int amaflag, const char *name_fmt, ...);
+struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const int amaflag, const char *name_fmt, ...) __attribute__((format(printf, 9, 10)));
 
 /*! 
  * \brief Queue an outgoing frame 

Modified: branches/1.6.0/include/asterisk/cli.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/cli.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/cli.h (original)
+++ branches/1.6.0/include/asterisk/cli.h Sat Nov 29 12:37:55 2008
@@ -30,7 +30,7 @@
 #include "asterisk/linkedlists.h"
 
 void ast_cli(int fd, const char *fmt, ...)
-	__attribute__ ((format (printf, 2, 3)));
+	__attribute__((format(printf, 2, 3)));
 
 #define RESULT_SUCCESS		0
 #define RESULT_SHOWUSAGE	1

Modified: branches/1.6.0/include/asterisk/compat.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/compat.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/compat.h (original)
+++ branches/1.6.0/include/asterisk/compat.h Sat Nov 29 12:37:55 2008
@@ -74,7 +74,7 @@
 #endif
 
 #if !defined(HAVE_ASPRINTF) && !defined(__AST_DEBUG_MALLOC)
-int __attribute__ ((format (printf, 2, 3))) asprintf(char **str, const char *fmt, ...);
+int __attribute__((format(printf, 2, 3))) asprintf(char **str, const char *fmt, ...);
 #endif
 
 #ifndef HAVE_GETLOADAVG
@@ -110,7 +110,7 @@
 #endif
 
 #if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
-int __attribute__ ((format (printf, 2, 0))) vasprintf(char **strp, const char *fmt, va_list ap);
+int __attribute__((format(printf, 2, 0))) vasprintf(char **strp, const char *fmt, va_list ap);
 #endif
 
 #ifndef HAVE_STRLCAT

Modified: branches/1.6.0/include/asterisk/devicestate.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/devicestate.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/devicestate.h (original)
+++ branches/1.6.0/include/asterisk/devicestate.h Sat Nov 29 12:37:55 2008
@@ -127,7 +127,7 @@
  * \retval -1 on failure
  */
 int ast_devstate_changed(enum ast_device_state state, const char *fmt, ...)
-	__attribute__ ((format (printf, 2, 3)));
+	__attribute__((format(printf, 2, 3)));
 
 /*! 
  * \brief Tells Asterisk the State for Device is changed
@@ -158,7 +158,7 @@
  * \note This is deprecated in favor of ast_devstate_changed()
  */
 int ast_device_state_changed(const char *fmt, ...)
-	__attribute__ ((format (printf, 1, 2)));
+	__attribute__((format(printf, 1, 2)));
 
 /*! 
  * \brief Tells Asterisk the State for Device is changed 

Modified: branches/1.6.0/include/asterisk/dundi.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/dundi.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/dundi.h (original)
+++ branches/1.6.0/include/asterisk/dundi.h Sat Nov 29 12:37:55 2008
@@ -43,13 +43,13 @@
 	unsigned char cmdresp;			/*!< Command / Response */
 	unsigned char cmdflags;			/*!< Command / Response specific flags*/
 	unsigned char ies[0];
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 struct dundi_ie_hdr {
 	unsigned char ie;
 	unsigned char len;
 	unsigned char iedata[0];
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 #define DUNDI_FLAG_RETRANS		(1 << 16)	/*!< Applies to dtrans */
 #define DUNDI_FLAG_RESERVED		(1 << 16)	/*!< Applies to strans */
@@ -78,7 +78,7 @@
 struct dundi_encblock {				/*!< AES-128 encrypted block */
 	unsigned char iv[16];			/*!< Initialization vector of random data */
 	unsigned char encdata[0];		/*!< Encrypted / compressed data */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 struct dundi_answer {
 	dundi_eid eid;				/*!< Original source of answer */
@@ -86,12 +86,12 @@
 	unsigned short flags;			/*!< Flags relating to answer */
 	unsigned short weight;			/*!< Weight of answers */
 	unsigned char data[0];			/*!< Protocol specific URI */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 struct dundi_hint {
 	unsigned short flags;			/*!< Flags relating to answer */
 	unsigned char data[0];			/*!< For data for hint */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 #define DUNDI_CAUSE_SUCCESS		0	/*!< Success */
 #define DUNDI_CAUSE_GENERAL		1	/*!< General unspecified failure */
@@ -105,14 +105,14 @@
 struct dundi_cause {			
 	unsigned char causecode;		/*!< Numerical cause (DUNDI_CAUSE_*) */
 	char desc[0];				/*!< Textual description */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 struct dundi_peer_status {
 	unsigned int flags;
 	unsigned short netlag;
 	unsigned short querylag;
 	dundi_eid peereid;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 #define DUNDI_PEER_PRIMARY		(1 << 0)
 #define DUNDI_PEER_SECONDARY		(1 << 1)

Modified: branches/1.6.0/include/asterisk/enum.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/enum.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/enum.h (original)
+++ branches/1.6.0/include/asterisk/enum.h Sat Nov 29 12:37:55 2008
@@ -28,7 +28,7 @@
 struct naptr {
 	unsigned short order;
 	unsigned short pref;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 struct enum_naptr_rr {
 	struct naptr naptr; /*!< order and preference of RR */

Modified: branches/1.6.0/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/linkedlists.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/linkedlists.h (original)
+++ branches/1.6.0/include/asterisk/linkedlists.h Sat Nov 29 12:37:55 2008
@@ -248,11 +248,11 @@
 	struct type *last;						\
 	ast_mutex_t lock;						\
 } name;									\
-static void  __attribute__ ((constructor)) __init_##name(void)		\
+static void  __attribute__((constructor)) __init_##name(void)		\
 {									\
         AST_LIST_HEAD_INIT(&name);					\
 }									\
-static void  __attribute__ ((destructor)) __fini_##name(void)		\
+static void  __attribute__((destructor)) __fini_##name(void)		\
 {									\
         AST_LIST_HEAD_DESTROY(&name);					\
 }									\
@@ -290,11 +290,11 @@
         struct type *last;                                              \
         ast_rwlock_t lock;                                              \
 } name;                                                                 \
-static void  __attribute__ ((constructor)) __init_##name(void)          \
+static void  __attribute__((constructor)) __init_##name(void)          \
 {                                                                       \
         AST_RWLIST_HEAD_INIT(&name);                                    \
 }                                                                       \
-static void  __attribute__ ((destructor)) __fini_##name(void)           \
+static void  __attribute__((destructor)) __fini_##name(void)           \
 {                                                                       \
         AST_RWLIST_HEAD_DESTROY(&name);                                 \
 }                                                                       \

Modified: branches/1.6.0/include/asterisk/logger.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/logger.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/logger.h (original)
+++ branches/1.6.0/include/asterisk/logger.h Sat Nov 29 12:37:55 2008
@@ -58,15 +58,14 @@
  */
 
 void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
-	__attribute__ ((format (printf, 5, 6)));
+	__attribute__((format(printf, 5, 6)));
 
 void ast_backtrace(void);
 
 /*! \brief Reload logger without rotating log files */
 int logger_reload(void);
 
-void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...)
-	__attribute__ ((format (printf, 5, 6)));
+void __attribute__((format(printf, 5, 6))) ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...);
 
 /*! Send a verbose message (based on verbose level)
  	\brief This works like ast_log, but prints verbose messages to the console depending on verbosity level set.

Modified: branches/1.6.0/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/manager.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/manager.h (original)
+++ branches/1.6.0/include/asterisk/manager.h Sat Nov 29 12:37:55 2008
@@ -179,7 +179,7 @@
 #define manager_event(category, event, contents , ...)	\
         __manager_event(category, event, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__)
 
-int __attribute__ ((format(printf, 6, 7))) __manager_event(int category, const char *event,
+int __attribute__((format(printf, 6, 7))) __manager_event(int category, const char *event,
 							   const char *file, int line, const char *func,
 							   const char *contents, ...);
 
@@ -201,7 +201,7 @@
 /*! \brief Send ack in manager list transaction */
 void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag);
 
-void __attribute__ ((format (printf, 2, 3))) astman_append(struct mansession *s, const char *fmt, ...);
+void __attribute__((format(printf, 2, 3))) astman_append(struct mansession *s, const char *fmt, ...);
 
 /*! \brief Determinie if a manager session ident is authenticated */
 int astman_is_authed(uint32_t ident);

Modified: branches/1.6.0/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/module.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/module.h (original)
+++ branches/1.6.0/include/asterisk/module.h Sat Nov 29 12:37:55 2008
@@ -250,11 +250,11 @@
 		flags_to_set,				\
 		AST_BUILDOPT_SUM,			\
 	};						\
-	static void  __attribute__ ((constructor)) __reg_module(void) \
+	static void  __attribute__((constructor)) __reg_module(void) \
 	{ \
 		ast_module_register(&__mod_info); \
 	} \
-	static void  __attribute__ ((destructor)) __unreg_module(void) \
+	static void  __attribute__((destructor)) __unreg_module(void) \
 	{ \
 		ast_module_unregister(&__mod_info); \
 	} \
@@ -344,11 +344,11 @@
 		.buildopt_sum = AST_BUILDOPT_SUM,		\
 		fields						\
 	};							\
-	static void  __attribute__ ((constructor)) __reg_module(void) \
+	static void  __attribute__((constructor)) __reg_module(void) \
 	{ \
 		ast_module_register(&__mod_info); \
 	} \
-	static void  __attribute__ ((destructor)) __unreg_module(void) \
+	static void  __attribute__((destructor)) __unreg_module(void) \
 	{ \
 		ast_module_unregister(&__mod_info); \
 	} \

Modified: branches/1.6.0/include/asterisk/res_odbc.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/res_odbc.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/res_odbc.h (original)
+++ branches/1.6.0/include/asterisk/res_odbc.h Sat Nov 29 12:37:55 2008
@@ -64,7 +64,7 @@
  * This function really only ever worked with MySQL, where the statement handle is
  * not prepared on the server.  If you are not using MySQL, you should avoid it.
  */
-int ast_odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) __attribute__ ((deprecated));
+int ast_odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) __attribute__((deprecated));
 
 /*! 
  * \brief Retrieves a connected ODBC object

Modified: branches/1.6.0/include/asterisk/stringfields.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/stringfields.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/stringfields.h (original)
+++ branches/1.6.0/include/asterisk/stringfields.h Sat Nov 29 12:37:55 2008
@@ -183,7 +183,7 @@
 */
 void __ast_string_field_ptr_build(struct ast_string_field_mgr *mgr,
 				  struct ast_string_field_pool **pool_head,
-				  const ast_string_field *ptr, const char *format, ...);
+				  const ast_string_field *ptr, const char *format, ...) __attribute((format(printf, 4, 5)));
 
 /*!
   \internal
@@ -198,7 +198,7 @@
 */
 void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr,
 				     struct ast_string_field_pool **pool_head,
-				     const ast_string_field *ptr, const char *format, va_list a1, va_list a2);
+				     const ast_string_field *ptr, const char *format, va_list a1, va_list a2) __attribute((format(printf, 4, 0)));
 
 /*!
   \brief Declare a string field

Modified: branches/1.6.0/include/asterisk/strings.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/strings.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/strings.h (original)
+++ branches/1.6.0/include/asterisk/strings.h Sat Nov 29 12:37:55 2008
@@ -221,7 +221,7 @@
   \retval 0 on success
   \retval non-zero on failure.
 */
-int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
+int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
 
 /*!
   \brief Build a string in a buffer, designed to be called repeatedly
@@ -235,7 +235,7 @@
   \param fmt printf-style format string
   \param ap varargs list of arguments for format
 */
-int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap) __attribute__((format (printf, 3, 0)));
+int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap) __attribute__((format(printf, 3, 0)));
 
 /*! 
  * \brief Make sure something is true.
@@ -630,8 +630,8 @@
  *       through calling one of the other functions or macros defined in this
  *       file.
  */
-int __ast_str_helper(struct ast_str **buf, size_t max_len,
-	int append, const char *fmt, va_list ap);
+int __attribute__((format(printf, 4, 0))) __ast_str_helper(struct ast_str **buf, size_t max_len,
+							   int append, const char *fmt, va_list ap);
 
 /*!
  * \brief Set a dynamic string using variable arguments
@@ -651,7 +651,7 @@
  * All the rest is the same as ast_str_set_va()
  */
 AST_INLINE_API(
-int __attribute__ ((format (printf, 3, 4))) ast_str_set(
+int __attribute__((format(printf, 3, 4))) ast_str_set(
 	struct ast_str **buf, size_t max_len, const char *fmt, ...),
 {
 	int res;
@@ -672,7 +672,7 @@
  * ast_str_set(), but the new data is appended to the current value.
  */
 AST_INLINE_API(
-int __attribute__ ((format (printf, 3, 4))) ast_str_append(
+int __attribute__((format(printf, 3, 4))) ast_str_append(
 	struct ast_str **buf, size_t max_len, const char *fmt, ...),
 {
 	int res;

Modified: branches/1.6.0/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/utils.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/asterisk/utils.h (original)
+++ branches/1.6.0/include/asterisk/utils.h Sat Nov 29 12:37:55 2008
@@ -554,7 +554,7 @@
 #define ast_asprintf(ret, fmt, ...) \
 	_ast_asprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, __VA_ARGS__)
 
-int __attribute__((format (printf, 5, 6)))
+int __attribute__((format(printf, 5, 6)))
 	_ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...);
 
 /*!
@@ -569,7 +569,7 @@
 	_ast_vasprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, (fmt), (ap))
 
 AST_INLINE_API(
-__attribute__((format (printf, 5, 0)))
+__attribute__((format(printf, 5, 0)))
 int _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, va_list ap),
 {
 	int res;

Modified: branches/1.6.0/include/jitterbuf.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/jitterbuf.h?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/include/jitterbuf.h (original)
+++ branches/1.6.0/include/jitterbuf.h Sat Nov 29 12:37:55 2008
@@ -163,7 +163,7 @@
 /*! \brief set jitterbuf conf */
 enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf);
 
-typedef	void __attribute__((format (printf, 1, 2))) (*jb_output_function_t)(const char *fmt, ...);
+typedef void __attribute__((format(printf, 1, 2))) (*jb_output_function_t)(const char *fmt, ...);
 void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg);
 
 #ifdef __cplusplus

Modified: branches/1.6.0/main/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/Makefile?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/main/Makefile (original)
+++ branches/1.6.0/main/Makefile Sat Nov 29 12:37:55 2008
@@ -140,7 +140,7 @@
 http.o: ASTCFLAGS+=$(GMIME_INCLUDE)
 endif
 
-stdtime/localtime.o: ASTCFLAGS+=$(AST_NO_STRICT_OVERFLOW)
+stdtime/localtime.o: ASTCFLAGS+=$(AST_NO_STRICT_OVERFLOW) -Wno-format-nonliteral
 
 AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
 AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))

Modified: branches/1.6.0/main/ast_expr2.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/ast_expr2.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/main/ast_expr2.c (original)
+++ branches/1.6.0/main/ast_expr2.c Sat Nov 29 12:37:55 2008
@@ -360,7 +360,7 @@
 } ;
 
 #ifdef STANDALONE
-void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((format (printf,5,6)));
+void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__((format(printf,5,6)));
 #endif
 
 struct val {

Modified: branches/1.6.0/main/dns.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/dns.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/main/dns.c (original)
+++ branches/1.6.0/main/dns.c Sat Nov 29 12:37:55 2008
@@ -156,7 +156,7 @@
 	unsigned short class;
 	unsigned int ttl;
 	unsigned short size;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 static int skip_name(unsigned char *s, int len)
 {

Modified: branches/1.6.0/main/event.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/event.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/main/event.c (original)
+++ branches/1.6.0/main/event.c Sat Nov 29 12:37:55 2008
@@ -50,7 +50,7 @@
 	/*! Total length of the IE payload */
 	uint16_t ie_payload_len;
 	unsigned char ie_payload[0];
-} __attribute__ ((packed));
+} __attribute__((packed));
 
 /*!
  * \brief An event
@@ -70,7 +70,7 @@
 	uint16_t event_len:16;
 	/*! The data payload of the event, made up of information elements */
 	unsigned char payload[0];
-} __attribute__ ((packed));
+} __attribute__((packed));
 
 struct ast_event_ref {
 	struct ast_event *event;

Modified: branches/1.6.0/main/features.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/features.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/main/features.c (original)
+++ branches/1.6.0/main/features.c Sat Nov 29 12:37:55 2008
@@ -231,7 +231,7 @@
 
 	goto_on_transfer = ast_strdupa(val);
 
-	if (!(xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, chan->name)))
+	if (!(xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "%s", chan->name)))
 		return;
 
 	for (x = goto_on_transfer; x && *x; x++) {

Modified: branches/1.6.0/main/srv.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/srv.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/main/srv.c (original)
+++ branches/1.6.0/main/srv.c Sat Nov 29 12:37:55 2008
@@ -73,7 +73,7 @@
 		unsigned short priority;
 		unsigned short weight;
 		unsigned short port;
-	} __attribute__ ((__packed__)) *srv = (struct srv *) answer;
+	} __attribute__((__packed__)) *srv = (struct srv *) answer;
 
 	int res = 0;
 	char repl[256] = "";

Modified: branches/1.6.0/main/utils.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/utils.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/main/utils.c (original)
+++ branches/1.6.0/main/utils.c Sat Nov 29 12:37:55 2008
@@ -1430,7 +1430,6 @@
 	return 0;
 }
 
-__attribute((format (printf, 4, 0)))
 void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr,
 				     struct ast_string_field_pool **pool_head,
 				     const ast_string_field *ptr, const char *format, va_list ap1, va_list ap2)
@@ -1462,7 +1461,6 @@
 	mgr->used += needed;
 }
 
-__attribute((format (printf, 4, 5)))
 void __ast_string_field_ptr_build(struct ast_string_field_mgr *mgr,
 				  struct ast_string_field_pool **pool_head,
 				  const ast_string_field *ptr, const char *format, ...)
@@ -1554,7 +1552,6 @@
  *	ast_str_append_va(...)
  */
 
-__attribute__((format (printf, 4, 0)))
 int __ast_str_helper(struct ast_str **buf, size_t max_len,
 	int append, const char *fmt, va_list ap)
 {

Modified: branches/1.6.0/makeopts.in
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/makeopts.in?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/makeopts.in (original)
+++ branches/1.6.0/makeopts.in Sat Nov 29 12:37:55 2008
@@ -66,6 +66,7 @@
 
 AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
 AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
+AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
 
 ASOUND_INCLUDE=@ALSA_INCLUDE@
 ASOUND_LIB=@ALSA_LIB@

Modified: branches/1.6.0/res/res_config_sqlite.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_config_sqlite.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/res/res_config_sqlite.c (original)
+++ branches/1.6.0/res/res_config_sqlite.c Sat Nov 29 12:37:55 2008
@@ -77,7 +77,6 @@
 
 #include "asterisk.h"
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
 #include <sqlite.h>
 
 #include "asterisk/logger.h"
@@ -524,46 +523,46 @@
 ");";
 
 /*! SQL query format to insert a CDR entry. */
-static char *sql_add_cdr_entry =
-"INSERT INTO '%q' ("
-"	clid,"
-"	src,"
-"	dst,"
-"	dcontext,"
-"	channel,"
-"	dstchannel,"
-"	lastapp,"
-"	lastdata,"
-"	start,"
-"	answer,"
-"	end,"
-"	duration,"
-"	billsec,"
-"	disposition,"
-"	amaflags,"
-"	accountcode,"
-"	uniqueid,"
-"	userfield"
-") VALUES ("
-"	'%q',"
-"	'%q',"
-"	'%q',"
-"	'%q',"
-"	'%q',"
-"	'%q',"
-"	'%q',"
-"	'%q',"
-"	datetime(%d,'unixepoch','localtime'),"
-"	datetime(%d,'unixepoch','localtime'),"
-"	datetime(%d,'unixepoch','localtime'),"
-"	'%ld',"
-"	'%ld',"
-"	'%ld',"
-"	'%ld',"
-"	'%q',"
-"	'%q',"
-"	'%q'"
-");";
+#define sql_add_cdr_entry \
+	"INSERT INTO '%q' (" \
+	"	clid," \
+	"	src," \
+	"	dst," \
+	"	dcontext," \
+	"	channel," \
+	"	dstchannel," \
+	"	lastapp," \
+	"	lastdata," \
+	"	start," \
+	"	answer," \
+	"	end," \
+	"	duration," \
+	"	billsec," \
+	"	disposition," \
+	"	amaflags," \
+	"	accountcode," \
+	"	uniqueid," \
+	"	userfield" \
+	") VALUES (" \
+	"	'%q'," \
+	"	'%q'," \
+	"	'%q'," \
+	"	'%q'," \
+	"	'%q'," \
+	"	'%q'," \
+	"	'%q'," \
+	"	'%q'," \
+	"	datetime(%d,'unixepoch','localtime')," \
+	"	datetime(%d,'unixepoch','localtime')," \
+	"	datetime(%d,'unixepoch','localtime')," \
+	"	'%ld'," \
+	"	'%ld'," \
+	"	'%ld'," \
+	"	'%ld'," \
+	"	'%q'," \
+	"	'%q'," \
+	"	'%q'" \
+	");"
 
 /*!
  * SQL query format to fetch the static configuration of a file.
@@ -571,11 +570,11 @@
  *
  * \see add_cfg_entry()
  */
-static char *sql_get_config_table =
-"SELECT *"
-"	FROM '%q'"
-"	WHERE filename = '%q' AND commented = 0"
-"	ORDER BY cat_metric ASC, var_metric ASC;";
+#define sql_get_config_table \
+	"SELECT *" \
+	"	FROM '%q'" \
+	"	WHERE filename = '%q' AND commented = 0" \
+	"	ORDER BY cat_metric ASC, var_metric ASC;"
 
 static int set_var(char **var, const char *name, const char *value)
 {

Modified: branches/1.6.0/utils/astman.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/utils/astman.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/utils/astman.c (original)
+++ branches/1.6.0/utils/astman.c Sat Nov 29 12:37:55 2008
@@ -147,7 +147,7 @@
 }
 
 
-static void __attribute__((format (printf, 2, 3))) fdprintf(int fd, char *fmt, ...)
+static void __attribute__((format(printf, 2, 3))) fdprintf(int fd, char *fmt, ...)
 {
 	char stuff[4096];
 	va_list ap;
@@ -417,7 +417,7 @@
 }
 
 
-static int __attribute__((format (printf, 2, 3))) manager_action(char *action, char *fmt, ...)
+static int __attribute__((format(printf, 2, 3))) manager_action(char *action, char *fmt, ...)
 {
 	struct ast_mansession *s;
 	char tmp[4096];

Modified: branches/1.6.0/utils/check_expr.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/utils/check_expr.c?view=diff&rev=159855&r1=159854&r2=159855
==============================================================================
--- branches/1.6.0/utils/check_expr.c (original)
+++ branches/1.6.0/utils/check_expr.c Sat Nov 29 12:37:55 2008
@@ -40,7 +40,7 @@
  *	ast_str_set_va(...)
  *	ast_str_append_va(...)
  */
-int __attribute__((format (printf, 4, 0))) __ast_str_helper(struct ast_str **buf, size_t max_len,
+int __attribute__((format(printf, 4, 0))) __ast_str_helper(struct ast_str **buf, size_t max_len,
 	int append, const char *fmt, va_list ap)
 {
 	int res, need;
@@ -125,7 +125,7 @@
 
 /* Our own version of ast_log, since the expr parser uses it. */
 

[... 174 lines stripped ...]



More information about the asterisk-commits mailing list