aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-29 17:57:39 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-29 17:57:39 +0000
commit246ce365ae87f9c1c908557f84f37ef8cdf92be4 (patch)
tree63088090cdb36c744acc52f3439a1da53cb5422d /main
parentbc729d661cc9f06743bbca398a6340029c7975e5 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@159818 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/ast_expr2.c2
-rw-r--r--main/dns.c2
-rw-r--r--main/event.c4
-rw-r--r--main/features.c2
-rw-r--r--main/logger.c2
-rw-r--r--main/srv.c2
-rw-r--r--main/utils.c3
-rw-r--r--main/xmldoc.c2
8 files changed, 8 insertions, 11 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index 37f4108bd..aabc39a42 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -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 {
diff --git a/main/dns.c b/main/dns.c
index ad1673830..66c21b367 100644
--- a/main/dns.c
+++ b/main/dns.c
@@ -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)
{
diff --git a/main/event.c b/main/event.c
index 8496ff8bf..956ce6f91 100644
--- a/main/event.c
+++ b/main/event.c
@@ -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;
diff --git a/main/features.c b/main/features.c
index af5754efe..1df9982db 100644
--- a/main/features.c
+++ b/main/features.c
@@ -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++) {
diff --git a/main/logger.c b/main/logger.c
index 2c312eecc..58813edda 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -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;
diff --git a/main/srv.c b/main/srv.c
index 1899e8b8f..664062b64 100644
--- a/main/srv.c
+++ b/main/srv.c
@@ -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] = "";
diff --git a/main/utils.c b/main/utils.c
index 0101d93ed..424504588 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -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)
{
diff --git a/main/xmldoc.c b/main/xmldoc.c
index 273ddc6ca..55b61ed77 100644
--- a/main/xmldoc.c
+++ b/main/xmldoc.c
@@ -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;