]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
incorporates r159808 from branches/1.4:
authorKevin P. Fleming <kpfleming@digium.com>
Sat, 29 Nov 2008 17:57:39 +0000 (17:57 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Sat, 29 Nov 2008 17:57:39 +0000 (17:57 +0000)
------------------------------------------------------------------------
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159818 65c4cc65-6c06-0410-ace0-fbb531ad65f3

42 files changed:
Makefile
cdr/cdr_tds.c
channels/chan_agent.c
channels/chan_iax2.c
channels/chan_misdn.c
channels/chan_sip.c
channels/chan_vpb.cc
configure
configure.ac
include/asterisk/astmm.h
include/asterisk/channel.h
include/asterisk/cli.h
include/asterisk/compat.h
include/asterisk/config.h
include/asterisk/devicestate.h
include/asterisk/dlinkedlists.h
include/asterisk/dundi.h
include/asterisk/enum.h
include/asterisk/linkedlists.h
include/asterisk/lock.h
include/asterisk/logger.h
include/asterisk/manager.h
include/asterisk/module.h
include/asterisk/res_odbc.h
include/asterisk/stringfields.h
include/asterisk/strings.h
include/asterisk/utils.h
include/jitterbuf.h
main/ast_expr2.c
main/dns.c
main/event.c
main/features.c
main/logger.c
main/srv.c
main/utils.c
main/xmldoc.c
makeopts.in
utils/astman.c
utils/check_expr.c
utils/conf2ael.c
utils/extconf.c
utils/frame.c

index 39b17c5f34ffe430f035e283fa82d157835c2b0f..519776f942dec54f5e624fbbb9e09f0459172494 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,13 @@ endif
 ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
 
 ifeq ($(AST_DEVMODE),yes)
-  ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -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)),)
index e05f21453490f771826c3224f6fcdd7e7dd54b49..408b255a47bbd9e6d23d1abbeb01738f7744c253 100644 (file)
@@ -103,7 +103,7 @@ static char *anti_injection(const char *, int);
 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);
index 6c3b838c0613df76329c8356fbdb47d045132df6..78bdb5a2085be4623c49618d6e6ce790dafdeac0 100644 (file)
@@ -1106,7 +1106,7 @@ static struct ast_channel *agent_new(struct agent_pvt *p, int state)
        }
 #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) {
index 378550a9933484e958fa0f6611455633bfb6c203..bbc08d9e17c3e575a9b595f361bba2a0fb55e4c9 100644 (file)
@@ -979,7 +979,7 @@ static void iax_error_output(const char *data)
        ast_log(LOG_WARNING, "%s", data);
 }
 
-static void __attribute__((format (printf, 1, 2))) jb_error_output(const char *fmt, ...)
+static void __attribute__((format(printf, 1, 2))) jb_error_output(const char *fmt, ...)
 {
        va_list args;
        char buf[1024];
@@ -991,7 +991,7 @@ static void __attribute__((format (printf, 1, 2))) jb_error_output(const char *f
        ast_log(LOG_ERROR, "%s", buf);
 }
 
-static void __attribute__((format (printf, 1, 2))) jb_warning_output(const char *fmt, ...)
+static void __attribute__((format(printf, 1, 2))) jb_warning_output(const char *fmt, ...)
 {
        va_list args;
        char buf[1024];
@@ -1003,7 +1003,7 @@ static void __attribute__((format (printf, 1, 2))) jb_warning_output(const char
        ast_log(LOG_WARNING, "%s", buf);
 }
 
-static void __attribute__((format (printf, 1, 2))) jb_debug_output(const char *fmt, ...)
+static void __attribute__((format(printf, 1, 2))) jb_debug_output(const char *fmt, ...)
 {
        va_list args;
        char buf[1024];
index 4b521c46461129ba7b091708cbd1cd720cfefeed..c3dde3cf67c6fcfa4aa30a7626f5411781e8aadb 100644 (file)
@@ -285,7 +285,7 @@ static pthread_t misdn_tasks_thread;
 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 );
index 6c7bf19706457b51b532b7cbeb1a83c0b0b940ab..a60efc524bd133d5481ac26615401bdff2a82826 100644 (file)
@@ -2895,7 +2895,7 @@ static struct ast_udptl_protocol sip_udptl = {
 };
 
 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 */
@@ -3206,9 +3206,9 @@ static void build_via(struct sip_pvt *p)
 
        /* 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?
@@ -3269,7 +3269,7 @@ static void ast_sip_ouraddrfor(struct in_addr *them, struct sockaddr_in *us)
 }
 
 /*! \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;
index f7223127636276f984588e80c41e6e75690b539c..e611ab097e7f4f114bb4d47d51a1ffb7e3042e98 100644 (file)
@@ -2478,7 +2478,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st
        }
        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;
index de4cc7c00f9c0c8457554ee4d27270847a6c1c7c..c0b79795d3f4466121b50f8144cf297bc88ac7e1 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 157820 .
+# From configure.ac Revision: 159631 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
@@ -975,6 +975,7 @@ PBX_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
 GC_CFLAGS
 GC_LDFLAGS
 AST_DECLARATION_AFTER_STATEMENT
+AST_FORTIFY_SOURCE
 AST_NO_STRICT_OVERFLOW
 AST_SHADOW_WARNINGS
 PBX_RTLD_NOLOAD
@@ -18327,6 +18328,19 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+{ echo "$as_me:$LINENO: checking for _FORTIFY_SOURCE support" >&5
+echo $ECHO_N "checking for _FORTIFY_SOURCE support... $ECHO_C" >&6; }
+if $(${CC} -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+       { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       AST_FORTIFY_SOURCE=-D_FORTIFY_SOURCE=2
+else
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       AST_FORTIFY_SOURCE=
+fi
+
+
 { echo "$as_me:$LINENO: checking for -fno-strict-overflow" >&5
 echo $ECHO_N "checking for -fno-strict-overflow... $ECHO_C" >&6; }
 if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
@@ -53372,6 +53386,7 @@ PBX_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP!$PBX_PTHREAD_RECURSIVE_MUTEX_INITIALI
 GC_CFLAGS!$GC_CFLAGS$ac_delim
 GC_LDFLAGS!$GC_LDFLAGS$ac_delim
 AST_DECLARATION_AFTER_STATEMENT!$AST_DECLARATION_AFTER_STATEMENT$ac_delim
+AST_FORTIFY_SOURCE!$AST_FORTIFY_SOURCE$ac_delim
 AST_NO_STRICT_OVERFLOW!$AST_NO_STRICT_OVERFLOW$ac_delim
 AST_SHADOW_WARNINGS!$AST_SHADOW_WARNINGS$ac_delim
 PBX_RTLD_NOLOAD!$PBX_RTLD_NOLOAD$ac_delim
@@ -53403,7 +53418,6 @@ PBX_H323!$PBX_H323$ac_delim
 PBX_IXJUSER!$PBX_IXJUSER$ac_delim
 CONFIG_SDL!$CONFIG_SDL$ac_delim
 CONFIG_GTK!$CONFIG_GTK$ac_delim
-PKGCONFIG!$PKGCONFIG$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -53445,11 +53459,12 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+PKGCONFIG!$PKGCONFIG$ac_delim
 CURL_CONFIG!$CURL_CONFIG$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 2; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 30113c15447b4163a1e35c7c6b586416944f341e..26c6e5a289cb748941105d596cf2c2cd7a03d35a 100644 (file)
@@ -515,6 +515,16 @@ else
 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
        AC_MSG_RESULT(yes)
index 5d0d47ff5249b917ca7b9b8fe5600094465d90d6..553587942698cced6f3921a18772cba77ad119bc 100644 (file)
@@ -51,9 +51,9 @@ void *__ast_realloc(void *ptr, size_t size, const char *file, int lineno, const
 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);
 
 
index 2c2cad6cf5001be34affaaa20b8500568f7170d5..ae785a298b0fea8ad61bdf09b27fd148c673e5eb 100644 (file)
@@ -644,14 +644,14 @@ enum channelreloadreason {
  * \deprecated You should use the ast_datastore_alloc() generic function instead.
  */
 struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid)
-       __attribute__ ((deprecated));
+       __attribute__((deprecated));
 
 /*!
  * \brief Free a channel data store object
  * \deprecated You should use the ast_datastore_free() generic function instead.
  */
 int ast_channel_datastore_free(struct ast_datastore *datastore)
-       __attribute__ ((deprecated));
+       __attribute__((deprecated));
 
 /*! \brief Inherit datastores from a parent to a child. */
 int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to);
@@ -702,7 +702,7 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state);
  * \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 
@@ -921,7 +921,7 @@ int ast_check_hangup(struct ast_channel *chan);
  * is earlier than current time plus the offset, it returns 1, if the two
  * time values are equal, it return 0, otherwise, it return -1.
  */
-int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset) __attribute__ ((deprecated));
+int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset) __attribute__((deprecated));
 int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offset);
 
 /*! \brief Set when to hang a channel up 
@@ -936,7 +936,7 @@ int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offs
  *
  * \return Nothing
  */
-void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset) __attribute__ ((deprecated));
+void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset) __attribute__((deprecated));
 void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset);
 
 /*! 
index 8b337aea15bee8559d6a12ca4821221ae008fa23..535b4e6af42f1496ab1f7d10c26c2a713a4f3388 100644 (file)
@@ -30,7 +30,7 @@ extern "C" {
 #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
index 0b431f5e020b7eae1dd615939e449ad807cbbbcd..572bb145bd7e8871bdd40e4f34e24fe7ee28906b 100644 (file)
@@ -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 @@ int unsetenv(const char *name);
 #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
index 15157e2399de1a2307dead4db64e8ff3bc2c39eb..b1177317c359f24bab3de507b11128fe89c255b4 100644 (file)
@@ -389,7 +389,7 @@ int ast_variable_update(struct ast_category *category, const char *variable,
                                                const char *value, const char *match, unsigned int object);
 
 int ast_config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator);
-int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator) __attribute__ ((deprecated));
+int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator) __attribute__((deprecated));
 
 struct ast_config *ast_config_internal_load(const char *configfile, struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl_file, const char *who_asked);
 
index bacf5464826956c8fd458bc057ac840a4eeb5130..839272732625cd20eedf718d33627c340d1378cd 100644 (file)
@@ -73,7 +73,7 @@ enum ast_device_state ast_state_chan2dev(enum ast_channel_state chanstate);
  *
  * \param devstate Current device state 
  */
-const char *devstate2str(enum ast_device_state devstate) attribute_pure __attribute__ ((deprecated));
+const char *devstate2str(enum ast_device_state devstate) attribute_pure __attribute__((deprecated));
 const char *ast_devstate2str(enum ast_device_state devstate) attribute_pure;
 
 /*! 
@@ -135,7 +135,7 @@ enum ast_device_state ast_device_state(const char *device);
  * \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
@@ -166,7 +166,7 @@ int ast_devstate_changed_literal(enum ast_device_state state, const char *device
  * \note This is deprecated in favor of ast_devstate_changed()
  */
 int ast_device_state_changed(const char *fmt, ...)
-       __attribute__ ((deprecated,format (printf, 1, 2)));
+       __attribute__((deprecated,format(printf, 1, 2)));
 
 /*! 
  * \brief Tells Asterisk the State for Device is changed 
@@ -182,7 +182,7 @@ int ast_device_state_changed(const char *fmt, ...)
  * \note This is deprecated in favor of ast_devstate_changed_literal()
  */
 int ast_device_state_changed_literal(const char *device)
-       __attribute__ ((deprecated));
+       __attribute__((deprecated));
 
 /*! 
  * \brief Add device state provider 
index 2f42fdd39c6a60327e1d997ead5ec8cf58bf2e4e..17bd7a43c03be6b5c0eeeae85140b89f02367a81 100644 (file)
@@ -253,11 +253,11 @@ struct name {                                                             \
        struct type *last;                                              \
        ast_mutex_t lock;                                               \
 } name;                                                                        \
-static void  __attribute__ ((constructor)) __init_##name(void)         \
+static void  __attribute__((constructor)) __init_##name(void)          \
 {                                                                      \
         AST_DLLIST_HEAD_INIT(&name);                                   \
 }                                                                      \
-static void  __attribute__ ((destructor)) __fini_##name(void)          \
+static void  __attribute__((destructor)) __fini_##name(void)           \
 {                                                                      \
         AST_DLLIST_HEAD_DESTROY(&name);                                        \
 }                                                                      \
@@ -295,11 +295,11 @@ struct name {                                                           \
         struct type *last;                                              \
         ast_rwlock_t lock;                                              \
 } name;                                                                 \
-static void  __attribute__ ((constructor)) __init_##name(void)          \
+static void  __attribute__((constructor)) __init_##name(void)          \
 {                                                                       \
         AST_RWDLLIST_HEAD_INIT(&name);                                    \
 }                                                                       \
-static void  __attribute__ ((destructor)) __fini_##name(void)           \
+static void  __attribute__((destructor)) __fini_##name(void)           \
 {                                                                       \
         AST_RWDLLIST_HEAD_DESTROY(&name);                                 \
 }                                                                       \
index c2a85493e48f1f65d9eeae61fd40df0c581dd6a9..2bffd02464f6a43c61f024fbeb0a8f13f640ac7d 100644 (file)
@@ -39,13 +39,13 @@ struct dundi_hdr {
        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 */
@@ -97,7 +97,7 @@ enum {
 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 */
@@ -105,12 +105,12 @@ struct dundi_answer {
        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__));
 
 enum {
        /*! Success */
@@ -134,14 +134,14 @@ enum {
 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__));
 
 enum {
        DUNDI_PEER_PRIMARY =        (1 << 0),
index 499e34673c2d92fbcbcfb8fb28e7b3a3078308db..d19368905d7d64b02b1712e10b9ff876dfa6d22d 100644 (file)
@@ -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 */
index 5e8f70c343819eda17020e6f734d3266febc46c4..f49150a50b859a4b8293986d4e58070b574f8d30 100644 (file)
@@ -248,11 +248,11 @@ struct name {                                                             \
        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 name {                                                           \
         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);                                 \
 }                                                                       \
index ae81fe46ecbaa4003af153c6cb6e5dbc62a7f6b8..8b48da9b2d5b69c4592896efcdf2787db0b42347 100644 (file)
@@ -1622,7 +1622,7 @@ static inline int ast_rwlock_trywrlock(ast_rwlock_t *prwlock)
  */
 #define __AST_MUTEX_DEFINE(scope, mutex, init_val, track)      \
        scope ast_mutex_t mutex = init_val;                     \
-static void  __attribute__ ((constructor)) init_##mutex(void)  \
+static void  __attribute__((constructor)) init_##mutex(void)   \
 {                                                              \
        if (track)                                              \
                ast_mutex_init(&mutex);                         \
@@ -1630,7 +1630,7 @@ static void  __attribute__ ((constructor)) init_##mutex(void)     \
                ast_mutex_init_notracking(&mutex);              \
 }                                                              \
                                                                \
-static void  __attribute__ ((destructor)) fini_##mutex(void)   \
+static void  __attribute__((destructor)) fini_##mutex(void)    \
 {                                                              \
        ast_mutex_destroy(&mutex);                              \
 }
@@ -1671,14 +1671,14 @@ static void  __attribute__ ((destructor)) fini_##mutex(void)    \
 #ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
 #define __AST_RWLOCK_DEFINE(scope, rwlock, init_val, track) \
         scope ast_rwlock_t rwlock = init_val; \
-static void  __attribute__ ((constructor)) init_##rwlock(void) \
+static void  __attribute__((constructor)) init_##rwlock(void) \
 { \
        if (track) \
                ast_rwlock_init(&rwlock); \
        else \
                ast_rwlock_init_notracking(&rwlock); \
 } \
-static void  __attribute__ ((destructor)) fini_##rwlock(void) \
+static void  __attribute__((destructor)) fini_##rwlock(void) \
 { \
         ast_rwlock_destroy(&rwlock); \
 }
index 91be73181267df2ddf7449e261f7e38f74a369f6..06f3f520606167dfebc64c18bd5ce39baa2cdc50 100644 (file)
@@ -58,15 +58,14 @@ extern "C" {
  */
 
 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.
@@ -75,17 +74,15 @@ void ast_queue_log(const char *queuename, const char *callid, const char *agent,
        Note the abscence of a comma after the VERBOSE_PREFIX_3.  This is important.
        VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined.
  */
-void __ast_verbose(const char *file, int line, const char *func, const char *fmt, ...)
-       __attribute__ ((format (printf, 4, 5)));
+void __attribute__((format(printf, 4, 5))) __ast_verbose(const char *file, int line, const char *func, const char *fmt, ...);
 
 #define ast_verbose(...) __ast_verbose(__FILE__, __LINE__, __PRETTY_FUNCTION__,  __VA_ARGS__)
 
-void __ast_verbose_ap(const char *file, int line, const char *func, const char *fmt, va_list ap);
+void __attribute__((format(printf, 4, 0))) __ast_verbose_ap(const char *file, int line, const char *func, const char *fmt, va_list ap);
 
 #define ast_verbose_ap(fmt, ap)        __ast_verbose_ap(__FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ap)
 
-void ast_child_verbose(int level, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+void __attribute__((format(printf, 2, 3))) ast_child_verbose(int level, const char *fmt, ...);
 
 int ast_register_verbose(void (*verboser)(const char *string)) attribute_warn_unused_result;
 int ast_unregister_verbose(void (*verboser)(const char *string)) attribute_warn_unused_result;
index 12e23e16482201600293884c5a0c692cc333541c..13d331f9376d040087a38ddc08033f3f05105d0d 100644 (file)
@@ -181,7 +181,7 @@ int astman_verify_session_writepermissions(uint32_t ident, int perm);
 #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, ...);
 
@@ -203,7 +203,7 @@ void astman_send_ack(struct mansession *s, const struct message *m, char *msg);
 /*! \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);
index 640c5af32f5b6778658f0fa0e968b8688e33747a..c952db4486f7d3aa6ac010834230ad857e2d97bc 100644 (file)
@@ -250,11 +250,11 @@ void ast_module_unref(struct ast_module *);
                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 @@ static void __restore_globals(void)
                .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); \
        } \
index d90dbba9f908f0a83b6cf769363943afd017d9dc..ad22045db506fe0df10bff6c8e4d3d84f4b63531 100644 (file)
@@ -91,7 +91,7 @@ struct odbc_cache_tables {
  * 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
index b0cda6902673d6458c70e19148a50423b0867b0d..4b18474154f76aba655f57382e6db630e9fcde47 100644 (file)
@@ -183,7 +183,7 @@ ast_string_field __ast_string_field_alloc_space(struct ast_string_field_mgr *mgr
 */
 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(struct ast_string_field_mgr *mgr,
 */
 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
index 7c25ecd5e0ae97111327d17ffb482d4c00b15e47..43d5bfc411f3b319bb11ea63aa6085117647a8d7 100644 (file)
@@ -217,7 +217,7 @@ void ast_copy_string(char *dst, const char *src, size_t size),
   \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
@@ -231,7 +231,7 @@ int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attri
   \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.
@@ -597,8 +597,8 @@ enum {
  *       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 from a va_list
@@ -638,7 +638,7 @@ int __ast_str_helper(struct ast_str **buf, size_t max_len,
  * }
  * \endcode
  */
-AST_INLINE_API(int ast_str_set_va(struct ast_str **buf, size_t max_len, const char *fmt, va_list ap),
+AST_INLINE_API(int __attribute__((format(printf, 3, 0))) ast_str_set_va(struct ast_str **buf, size_t max_len, const char *fmt, va_list ap),
 {
        return __ast_str_helper(buf, max_len, 0, fmt, ap);
 }
@@ -649,7 +649,7 @@ AST_INLINE_API(int ast_str_set_va(struct ast_str **buf, size_t max_len, const ch
  *
  * Same as ast_str_set_va(), but append to the current content.
  */
-AST_INLINE_API(int ast_str_append_va(struct ast_str **buf, size_t max_len, const char *fmt, va_list ap),
+AST_INLINE_API(int __attribute__((format(printf, 3, 0))) ast_str_append_va(struct ast_str **buf, size_t max_len, const char *fmt, va_list ap),
 {
        return __ast_str_helper(buf, max_len, 1, fmt, ap);
 }
@@ -673,7 +673,7 @@ AST_INLINE_API(int ast_str_append_va(struct ast_str **buf, size_t max_len, const
  * 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;
@@ -694,7 +694,7 @@ int __attribute__ ((format (printf, 3, 4))) ast_str_set(
  * 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;
index ed69de6cecdff2b0cb8b049c8d04f1ed00e04875..3737ef9c2729b15429ff1995bd8cd3c65d6fae47 100644 (file)
@@ -554,7 +554,7 @@ char * attribute_malloc _ast_strndup(const char *str, size_t len, const char *fi
 #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 @@ int __attribute__((format (printf, 5, 6)))
        _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;
@@ -676,7 +676,7 @@ static void force_inline _ast_assert(int condition, const char *condition_str,
  */
 struct ast_eid {
        unsigned char eid[6];
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 /*!
  * \brief Global EID
index 00f26e21cc77e541a73bb8828c005cb1fb107f5b..6da11a65bd418e7a127a68d85da5008db9667a62 100644 (file)
@@ -163,7 +163,7 @@ enum jb_return_code jb_getinfo(jitterbuf *jb, jb_info *stats);
 /*! \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
index 37f4108bd641b9b3952f425fa279d9fe041c114b..aabc39a42c9d765ce52952cf95924afb3342a77b 100644 (file)
@@ -372,7 +372,7 @@ enum valtype {
 } ;
 
 #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 {
index ad1673830d4ce62f1623a57b39f9f64a8b716cdc..66c21b3678e49b9f72a353718a3783a1d3ddca7e 100644 (file)
@@ -156,7 +156,7 @@ struct dn_answer {
        unsigned short class;
        unsigned int ttl;
        unsigned short size;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 static int skip_name(unsigned char *s, int len)
 {
index 8496ff8bf33f9df7d86feae8a74f5d39a28b92dd..956ce6f91145479cd523ac53a0c3564362298846 100644 (file)
@@ -52,7 +52,7 @@ struct ast_event_ie {
        /*! Total length of the IE payload */
        uint16_t ie_payload_len;
        unsigned char ie_payload[0];
-} __attribute__ ((packed));
+} __attribute__((packed));
 
 /*!
  * \brief An event
@@ -72,7 +72,7 @@ struct ast_event {
        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;
index af5754efe1ea8f28921e28507ad98325e4557cd1..1df9982dbf6f0cd9aff99f0ae1669386bc6722a3 100644 (file)
@@ -334,7 +334,7 @@ static void check_goto_on_transfer(struct ast_channel *chan)
 
        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++) {
index 2c312eecc601b89403a10ec1716ef4168ec2bfff..58813edda6bec401b7dc4cc8b82647f79d450da2 100644 (file)
@@ -1298,7 +1298,7 @@ void __ast_verbose(const char *file, int line, const char *func, const char *fmt
 
 /* No new code should use this directly, but we have the ABI for backwards compat */
 #undef ast_verbose
-void ast_verbose(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+void __attribute__((format(printf, 1,2))) ast_verbose(const char *fmt, ...);
 void ast_verbose(const char *fmt, ...)
 {
        va_list ap;
index 1899e8b8f4e2534fe249bc84a993bece65731fdc..664062b641655953f605472c3146d68aef82370d 100644 (file)
@@ -73,7 +73,7 @@ static int parse_srv(unsigned char *answer, int len, unsigned char *msg, struct
                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] = "";
index 0101d93ed03385283500ab61000be89156ee41ea..424504588e8f4527d7ce380a90238ce0eb23c429 100644 (file)
@@ -1537,7 +1537,6 @@ int __ast_string_field_ptr_grow(struct ast_string_field_mgr *mgr, size_t needed,
        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)
@@ -1569,7 +1568,6 @@ void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr,
        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, ...)
@@ -1661,7 +1659,6 @@ int ast_get_time_t(const char *src, time_t *dst, time_t _default, int *consumed)
  *     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)
 {
index 273ddc6ca690a36d929758f76a9df162cfa713c6..55b61ed77eddeeeb8d33a017a96738557eda2a15 100644 (file)
@@ -510,7 +510,7 @@ static struct ast_xml_node *xmldoc_get_node(const char *type, const char *name,
  *  \param syntax Output buffer for the concatenated values.
  *  \param fmt A format string that will be used in a sprintf call.
  */
-static __attribute__((format(printf,4,5))) void xmldoc_reverse_helper(int reverse, int *len, char **syntax, const char *fmt, ...)
+static void __attribute__((format(printf, 4, 5))) xmldoc_reverse_helper(int reverse, int *len, char **syntax, const char *fmt, ...)
 {
        int totlen, tmpfmtlen;
        char *tmpfmt, tmp;
index 0c0ee3327c2dd477e42263de2e22b8fe1f340bbf..09020e59bb561d221c0c545a2f3612c2d448d7ac 100644 (file)
@@ -68,6 +68,7 @@ AST_DEVMODE=@AST_DEVMODE@
 AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
 AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
 AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
+AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
 
 ALSA_INCLUDE=@ALSA_INCLUDE@
 ALSA_LIB=@ALSA_LIB@
index e116d61657e16e8898b34e7c21119b2e2a7abbc9..6bb4c4c6f894aed57f472cab57922fa4cad71f65 100644 (file)
@@ -147,7 +147,7 @@ static void del_chan(char *name)
 }
 
 
-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 struct message *wait_for_response(int timeout)
 }
 
 
-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];
index e533e381ae7c599ef4618673eec65c93b1d9d407..ab1cee19a707da9fd185b9dcc6956c649c3fe846 100644 (file)
@@ -40,7 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  *     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;
@@ -148,7 +148,7 @@ struct varz *global_varlist;
 
 /* Our own version of ast_log, since the expr parser uses it. */
 
-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)));
 
 void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
 {
index 705932a09dbcbfb7a6a08d355e609fa517849557..26ccfe568947f0cbb1b6a9f8ca19114789df8106 100644 (file)
@@ -92,7 +92,7 @@ void ast_unregister_file_version(const char *file)
 int ast_add_profile(const char *x, uint64_t scale) { return 0;}
 #endif
 /* Our own version of ast_log, since the expr parser uses it. -- stolen from utils/check_expr.c */
-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)));
 
 void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
 {
index a2e82a4406cac8683f026ad96fe8f93af025436d..4a5c6c3e05e908a5ed465c39c25a3f1b6f82baa3 100644 (file)
@@ -89,10 +89,10 @@ struct ast_channel
 void ast_backtrace(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)));
+       __attribute__((format(printf, 5, 6)));
 
 /* IN CONFLICT: void ast_verbose(const char *fmt, ...)
-   __attribute__ ((format (printf, 1, 2))); */
+   __attribute__((format(printf, 1, 2))); */
 
 int ast_register_verbose(void (*verboser)(const char *string));
 int ast_unregister_verbose(void (*verboser)(const char *string));
@@ -666,11 +666,11 @@ static inline int ast_cond_timedwait(ast_cond_t *cond, ast_mutex_t *t, const str
  constructors/destructors to create/destroy mutexes.  */
 #define __AST_MUTEX_DEFINE(scope, mutex) \
        scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE; \
-static void  __attribute__ ((constructor)) init_##mutex(void) \
+static void  __attribute__((constructor)) init_##mutex(void) \
 { \
        ast_mutex_init(&mutex); \
 } \
-static void  __attribute__ ((destructor)) fini_##mutex(void) \
+static void  __attribute__((destructor)) fini_##mutex(void) \
 { \
        ast_mutex_destroy(&mutex); \
 }
@@ -754,11 +754,11 @@ static inline int ast_rwlock_trywrlock(ast_rwlock_t *prwlock)
 #ifndef HAVE_PTHREAD_RWLOCK_INITIALIZER
 #define __AST_RWLOCK_DEFINE(scope, rwlock) \
         scope ast_rwlock_t rwlock; \
-static void  __attribute__ ((constructor)) init_##rwlock(void) \
+static void  __attribute__((constructor)) init_##rwlock(void) \
 { \
         ast_rwlock_init(&rwlock); \
 } \
-static void  __attribute__ ((destructor)) fini_##rwlock(void) \
+static void  __attribute__((destructor)) fini_##rwlock(void) \
 { \
         ast_rwlock_destroy(&rwlock); \
 }
@@ -1074,7 +1074,7 @@ char * attribute_malloc _ast_strndup(const char *str, size_t len, const char *fi
        _ast_asprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, __VA_ARGS__)
 
 AST_INLINE_API(
-__attribute__((format (printf, 5, 6)))
+__attribute__((format(printf, 5, 6)))
 int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...),
 {
        int res;
@@ -1101,7 +1101,7 @@ int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, co
        _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;
@@ -2014,11 +2014,11 @@ struct name {                                                           \
        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);                                  \
 }                                                                      \
@@ -2056,11 +2056,11 @@ struct name {                                                           \
         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);                                 \
 }                                                                       \
@@ -2671,7 +2671,7 @@ static void ast_log(int level, const char *file, int line, const char *function,
        va_end(vars);
 }
 
-void __attribute__((format (printf, 1, 2))) ast_verbose(const char *fmt, ...)
+void __attribute__((format(printf, 1, 2))) ast_verbose(const char *fmt, ...)
 {
        va_list vars;
        va_start(vars,fmt);
index 9f79230b09ec612c27d457fbf2b6adb0f844de3e..abc3a300053fdd808f4a81ea7f9e7d6b25c65bd4 100644 (file)
@@ -968,7 +968,7 @@ int workloop( FILE *theinfile, FILE *theoutfile,
   return TRUE;      /* Input file done with, no errors. */
 }
 
-int __attribute__((format (printf,1,2))) chat( const char *format, ...)
+int __attribute__((format(printf,1,2))) chat( const char *format, ...)
 {
     va_list ap;
     int result = 0;
@@ -982,7 +982,7 @@ int __attribute__((format (printf,1,2))) chat( const char *format, ...)
     return result;
 }
 
-int __attribute__((format (printf,1,2))) inform( const char *format, ...)
+int __attribute__((format(printf,1,2))) inform( const char *format, ...)
 {
     va_list ap;
     int result = 0;
@@ -996,7 +996,7 @@ int __attribute__((format (printf,1,2))) inform( const char *format, ...)
     return result;
 }
 
-int __attribute__((format (printf,1,2))) error( const char *format, ...)
+int __attribute__((format(printf,1,2))) error( const char *format, ...)
 {
     va_list ap;
     int result;
@@ -1007,7 +1007,7 @@ int __attribute__((format (printf,1,2))) error( const char *format, ...)
     return result;
 }
 
-void __attribute__((format (printf,1,2))) fatalerror( const char *format, ...)
+void __attribute__((format(printf,1,2))) fatalerror( const char *format, ...)
 {
     va_list ap;
 
@@ -1023,7 +1023,7 @@ void fatalperror( const char *string)
   myexit( 1);
 }
 
-int __attribute__((format (printf,1,2))) say( const char *format, ...)
+int __attribute__((format(printf,1,2))) say( const char *format, ...)
 {
     va_list ap;
     int result;