ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
ifeq ($(AST_DEVMODE),yes)
- ASTCFLAGS+=-Werror -Wunused $(AST_DECLARATION_AFTER_STATEMENT)
+ ASTCFLAGS+=-Werror
+ ASTCFLAGS+=-Wunused
+ ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
+ ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
+# ASTCFLAGS+=-Wundef
+ ASTCFLAGS+=-Wformat -Wformat-security
+ ASTCFLAGS+=-Wmissing-format-attribute
+# ASTCFLAGS+=-Wformat=2
endif
ifneq ($(findstring BSD,$(OSARCH)),)
}
#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) {
ast_log(LOG_WARNING, "%s", data);
}
-static void 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];
ast_log(LOG_ERROR, "%s", buf);
}
-static void 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];
ast_log(LOG_WARNING, "%s", buf);
}
-static void 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];
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 );
/* z9hG4bK is a magic cookie. See RFC 3261 section 8.1.1.7 */
ast_string_field_build(p, via, "SIP/2.0/UDP %s:%d;branch=z9hG4bK%08x%s",
- ast_inet_ntoa(p->ourip), ourport, p->branch, rport);
+ ast_inet_ntoa(p->ourip), ourport, (int) p->branch, rport);
}
/*! \brief NAT fix - decide which IP address to use for ASterisk server?
#define append_history(p, event, fmt , args... ) append_history_full(p, "%-15s " fmt, event, ## args)
static void append_history_full(struct sip_pvt *p, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
+ __attribute__((format(printf, 2, 3)));
/*! \brief Append to SIP dialog history with arg list */
-static void append_history_va(struct sip_pvt *p, const char *fmt, va_list ap)
+static void __attribute__((format(printf, 2, 0))) 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;
}
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;
#! /bin/sh
-# From configure.ac Revision: 151241 .
+# From configure.ac Revision: 159025 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.4.
#
GC_CFLAGS
GC_LDFLAGS
AST_DECLARATION_AFTER_STATEMENT
+AST_FORTIFY_SOURCE
AST_NO_STRICT_OVERFLOW
PBX_DAHDI_TRANSCODE
GSM_INTERNAL
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
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
PBX_DAHDI_TRANSCODE!$PBX_DAHDI_TRANSCODE$ac_delim
GSM_INTERNAL!$GSM_INTERNAL$ac_delim
EDITLINE_LIB!$EDITLINE_LIB$ac_delim
PBX_H323!$PBX_H323$ac_delim
PBX_IXJUSER!$PBX_IXJUSER$ac_delim
-GTKCONFIG!$GTKCONFIG$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+GTKCONFIG!$GTKCONFIG$ac_delim
PBX_GTK!$PBX_GTK$ac_delim
GTK_INCLUDE!$GTK_INCLUDE$ac_delim
GTK_LIB!$GTK_LIB$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 10; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
AC_MSG_RESULT(yes)
AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
else
- AC_MSG_RESULT(no)
- AST_DECLARATION_AFTER_STATEMENT=
+ AC_MSG_RESULT(no)
+ 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
AC_MSG_RESULT(yes)
AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
else
- AC_MSG_RESULT(no)
- AST_NO_STRICT_OVERFLOW=
+ AC_MSG_RESULT(no)
+ AST_NO_STRICT_OVERFLOW=
fi
AC_SUBST(AST_NO_STRICT_OVERFLOW)
by default set to the "default" context and
extension "s"
*/
-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 */
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f);
/*! return a mallocd string with the result of sprintf of the fmt and following args */
-char *ast_safe_string_alloc(const char *fmt, ...);
-
+char __attribute__((format(printf, 1, 2))) *ast_safe_string_alloc(const char *fmt, ...);
/*! Start a tone going */
#include "asterisk/linkedlists.h"
void ast_cli(int fd, char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
+ __attribute__((format(printf, 2, 3)));
#define RESULT_SUCCESS 0
#define RESULT_SHOWUSAGE 1
* Returns 0 on success, -1 on failure
*/
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
/*!\brief A DUNDi Entity ID is essentially a MAC address, brief and unique */
struct _dundi_eid {
unsigned char eid[6];
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
typedef struct _dundi_eid dundi_eid;
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 */
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 */
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 */
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)
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); \
} \
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); \
} \
destructors to destroy mutexes and create it on the fly. */
#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); \
else \
ast_mutex_init_notracking(&mutex); \
} \
-static void __attribute__ ((destructor)) fini_##mutex(void) \
+static void __attribute__((destructor)) fini_##mutex(void) \
{ \
ast_mutex_destroy(&mutex); \
}
#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); \
}
\param fmt This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-)
*/
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);
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)));
+ __attribute__((format(printf, 5, 6)));
/*! 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.
VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined.
*/
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));
\param event Event name
\param contents Contents of event
*/
-int __attribute__ ((format (printf, 3,4))) manager_event(int category, const char *event, const char *contents, ...);
+int __attribute__((format(printf, 3,4))) manager_event(int category, const char *event, const char *contents, ...);
/*! Get header from mananger transaction */
const char *astman_get_header(const struct message *m, char *var);
void astman_send_response(struct mansession *s, const struct message *m, char *resp, char *msg);
void astman_send_ack(struct mansession *s, const struct message *m, char *msg);
-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, ...);
/*! Called by Asterisk initialization */
int init_manager(void);
flags_to_set | AST_MODFLAG_BUILDSUM, \
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); \
} \
.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); \
} \
* 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
* \param name The name of the ODBC class for which a connection is needed.
*/
void __ast_string_field_index_build(struct ast_string_field_mgr *mgr,
ast_string_field *fields, int num_fields,
- int index, const char *format, ...);
+ int index, const char *format, ...) __attribute__((format(printf, 5, 6)));
/*!
\internal
*/
void __ast_string_field_index_build_va(struct ast_string_field_mgr *mgr,
ast_string_field *fields, int num_fields,
- int index, const char *format, va_list a1, va_list a2);
+ int index, const char *format, va_list a1, va_list a2) __attribute__((format(printf, 5, 0)));
/*!
\brief Declare a string field
\param fmt printf-style format string
\return 0 on success, 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
\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);
+int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap) __attribute__((format(printf, 3, 0)));
/*! Make sure something is true */
/*!
* writing over it.
*/
int ast_dynamic_str_thread_build_va(struct ast_dynamic_str **buf, size_t max_len,
- struct ast_threadstorage *ts, int append, const char *fmt, va_list ap);
+ struct ast_threadstorage *ts, int append, const char *fmt, va_list ap) __attribute__((format(printf, 5, 0)));
/*!
* \brief Set a thread locally stored dynamic string using variable arguments
* \endcode
*/
AST_INLINE_API(
-int __attribute__ ((format (printf, 4, 5))) ast_dynamic_str_thread_set(
+int __attribute__((format(printf, 4, 5))) ast_dynamic_str_thread_set(
struct ast_dynamic_str **buf, size_t max_len,
struct ast_threadstorage *ts, const char *fmt, ...),
{
* the string, this function appends to the current value.
*/
AST_INLINE_API(
-int __attribute__ ((format (printf, 4, 5))) ast_dynamic_str_thread_append(
+int __attribute__((format(printf, 4, 5))) ast_dynamic_str_thread_append(
struct ast_dynamic_str **buf, size_t max_len,
struct ast_threadstorage *ts, const char *fmt, ...),
{
* family of functions.
*/
AST_INLINE_API(
-int __attribute__ ((format (printf, 3, 4))) ast_dynamic_str_set(
+int __attribute__((format(printf, 3, 4))) ast_dynamic_str_set(
struct ast_dynamic_str **buf, size_t max_len,
const char *fmt, ...),
{
* of setting a new value.
*/
AST_INLINE_API(
-int __attribute__ ((format (printf, 3, 4))) ast_dynamic_str_append(
+int __attribute__((format(printf, 3, 4))) ast_dynamic_str_append(
struct ast_dynamic_str **buf, size_t max_len,
const char *fmt, ...),
{
#define ast_asprintf(ret, fmt, ...) \
_ast_asprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, __VA_ARGS__)
-int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...) __attribute__ ((format (printf, 5, 6)));
+int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...) __attribute__((format(printf, 5, 6)));
/*!
* \brief A wrapper for vasprintf()
_ast_vasprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, (fmt), (ap))
AST_INLINE_API(
-int _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, va_list ap),
+int __attribute__((format(printf, 5, 0))) _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, va_list ap),
{
int res;
/* set jitterbuf conf */
enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf);
-typedef void (*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);
+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
}
} ;
#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 {
unsigned short class;
unsigned int ttl;
unsigned short size;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
static int skip_name(unsigned char *s, int len)
{
struct naptr {
unsigned short order;
unsigned short pref;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
/*! \brief Parse NAPTR record information elements */
static unsigned int parse_ie(char *data, unsigned int maxdatalen, unsigned char *src, unsigned int srclen)
/* if a hard clamp was requested, use it */
if ((jb->info.conf.max_jitterbuf) && ((jb->info.target - jb->info.min) > jb->info.conf.max_jitterbuf)) {
- jb_dbg("clamping target from %d to %d\n", (jb->info.target - jb->info.min), jb->info.conf.max_jitterbuf);
+ jb_dbg("clamping target from %ld to %ld\n", (jb->info.target - jb->info.min), jb->info.conf.max_jitterbuf);
jb->info.target = jb->info.min + jb->info.conf.max_jitterbuf;
}
return;
}
-static void ast_log_vsyslog(int level, const char *file, int line, const char *function, const char *fmt, va_list args)
+static void __attribute__((format(printf, 5, 0))) ast_log_vsyslog(int level, const char *file, int line, const char *function, const char *fmt, va_list args)
{
char buf[BUFSIZ];
char *s;
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] = "";
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@
AGI_RESULT_HANGUP
};
-static int agi_debug_cli(int fd, char *fmt, ...)
+static int __attribute__((format(printf, 2, 3))) agi_debug_cli(int fd, char *fmt, ...)
{
char *stuff;
int res = 0;
switch(res) {
case RESULT_SHOWUSAGE:
fdprintf(agi->fd, "520-Invalid command syntax. Proper usage follows:\n");
- fdprintf(agi->fd, c->usage);
+ fdprintf(agi->fd, "%s", c->usage);
fdprintf(agi->fd, "520 End of proper usage.\n");
break;
case AST_PBX_KEEPALIVE:
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++) {
AST_LIST_TRAVERSE_SAFE_END
}
-static void fdprintf(int fd, char *fmt, ...)
+static void __attribute__((format(printf, 2, 3))) fdprintf(int fd, char *fmt, ...)
{
char stuff[4096];
va_list ap;
return NULL;
}
-static int 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];
static void try_status(void)
{
struct message *m;
- manager_action("Status", "");
+ manager_action("Status", "%s", "");
m = wait_for_response(10000);
if (!m) {
show_message("Status Failed", "Timeout waiting for response");
/* 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, ...)
{
return TRUE; /* Input file done with, no errors. */
}
-int chat( const char *format, ...)
+int __attribute__((format(printf, 1, 2))) chat( const char *format, ...)
{
va_list ap;
int result = 0;
}
-int inform( const char *format, ...)
+int __attribute__((format(printf, 1, 2))) inform( const char *format, ...)
{
va_list ap;
int result = 0;
return result;
}
-int error( const char *format, ...)
+int __attribute__((format(printf, 1, 2))) error( const char *format, ...)
{
va_list ap;
int result;
return result;
}
-void fatalerror( const char *format, ...)
+void __attribute__((format(printf, 1, 2))) fatalerror( const char *format, ...)
{
va_list ap;
myexit( 1);
}
-int say( const char *format, ...)
+int __attribute__((format(printf, 1, 2))) say( const char *format, ...)
{
va_list ap;
int result;