summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2013-10-21 06:37:30 +0000
committerLiong Sauw Ming <ming@teluu.com>2013-10-21 06:37:30 +0000
commit1b2ad20c6811a916650a0c510724d9f1b8a7d6d1 (patch)
treeb955787f6c1e48e03bc7d9a2f6a9b816942fc700 /pjlib
parent674d145645a4f8a8392ec8d76b34256000ebd39c (diff)
Re #1630 (misc):
Fixed compiler warnings. Thanks to Mark Michelson for the patch. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4624 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/include/pj/compat/cc_armcc.h1
-rw-r--r--pjlib/include/pj/compat/cc_codew.h1
-rw-r--r--pjlib/include/pj/compat/cc_gcc.h2
-rw-r--r--pjlib/include/pj/compat/cc_gcce.h1
-rw-r--r--pjlib/include/pj/compat/cc_msvc.h1
-rw-r--r--pjlib/include/pj/compat/cc_mwcc.h1
-rw-r--r--pjlib/include/pj/list.h2
-rw-r--r--pjlib/src/pj/log.c6
-rw-r--r--pjlib/src/pj/pool_buf.c2
-rw-r--r--pjlib/src/pj/ssl_sock_ossl.c6
10 files changed, 15 insertions, 8 deletions
diff --git a/pjlib/include/pj/compat/cc_armcc.h b/pjlib/include/pj/compat/cc_armcc.h
index b4af09c7..16f9654d 100644
--- a/pjlib/include/pj/compat/cc_armcc.h
+++ b/pjlib/include/pj/compat/cc_armcc.h
@@ -43,6 +43,7 @@
#define PJ_THREAD_FUNC
#define PJ_NORETURN
#define PJ_ATTR_NORETURN __attribute__ ((noreturn))
+#define PJ_ATTR_MAY_ALIAS __attribute__ ((__may_alias__))
#define PJ_HAS_INT64 1
diff --git a/pjlib/include/pj/compat/cc_codew.h b/pjlib/include/pj/compat/cc_codew.h
index cdd5cf0a..4674a121 100644
--- a/pjlib/include/pj/compat/cc_codew.h
+++ b/pjlib/include/pj/compat/cc_codew.h
@@ -39,6 +39,7 @@
#define PJ_THREAD_FUNC
#define PJ_NORETURN
#define PJ_ATTR_NORETURN
+#define PJ_ATTR_MAY_ALIAS
#define PJ_HAS_INT64 1
diff --git a/pjlib/include/pj/compat/cc_gcc.h b/pjlib/include/pj/compat/cc_gcc.h
index 77d93f32..df257029 100644
--- a/pjlib/include/pj/compat/cc_gcc.h
+++ b/pjlib/include/pj/compat/cc_gcc.h
@@ -53,11 +53,13 @@
typedef uint64_t pj_uint64_t;
#define PJ_INLINE_SPECIFIER static __inline
#define PJ_ATTR_NORETURN
+ #define PJ_ATTR_MAY_ALIAS
#else
typedef long long pj_int64_t;
typedef unsigned long long pj_uint64_t;
#define PJ_INLINE_SPECIFIER static inline
#define PJ_ATTR_NORETURN __attribute__ ((noreturn))
+ #define PJ_ATTR_MAY_ALIAS __attribute__((__may_alias__))
#endif
#define PJ_INT64(val) val##LL
diff --git a/pjlib/include/pj/compat/cc_gcce.h b/pjlib/include/pj/compat/cc_gcce.h
index e3227435..06de5be6 100644
--- a/pjlib/include/pj/compat/cc_gcce.h
+++ b/pjlib/include/pj/compat/cc_gcce.h
@@ -39,6 +39,7 @@
#define PJ_THREAD_FUNC
#define PJ_NORETURN
#define PJ_ATTR_NORETURN __attribute__ ((noreturn))
+#define PJ_ATTR_MAY_ALIAS __attribute__ ((__may_alias__))
#define PJ_HAS_INT64 1
diff --git a/pjlib/include/pj/compat/cc_msvc.h b/pjlib/include/pj/compat/cc_msvc.h
index 0b1fd68a..659d3a42 100644
--- a/pjlib/include/pj/compat/cc_msvc.h
+++ b/pjlib/include/pj/compat/cc_msvc.h
@@ -68,6 +68,7 @@
#define PJ_THREAD_FUNC
#define PJ_NORETURN __declspec(noreturn)
#define PJ_ATTR_NORETURN
+#define PJ_ATTR_MAY_ALIAS
#define PJ_HAS_INT64 1
diff --git a/pjlib/include/pj/compat/cc_mwcc.h b/pjlib/include/pj/compat/cc_mwcc.h
index 1efd3205..6c9e617e 100644
--- a/pjlib/include/pj/compat/cc_mwcc.h
+++ b/pjlib/include/pj/compat/cc_mwcc.h
@@ -39,6 +39,7 @@
#define PJ_THREAD_FUNC
#define PJ_NORETURN
#define PJ_ATTR_NORETURN __attribute__ ((noreturn))
+#define PJ_ATTR_MAY_ALIAS
#define PJ_HAS_INT64 1
diff --git a/pjlib/include/pj/list.h b/pjlib/include/pj/list.h
index 0cc4b997..a66b821e 100644
--- a/pjlib/include/pj/list.h
+++ b/pjlib/include/pj/list.h
@@ -74,7 +74,7 @@ PJ_BEGIN_DECL
struct pj_list
{
PJ_DECL_LIST_MEMBER(void);
-};
+} PJ_ATTR_MAY_ALIAS; /* may_alias avoids warning with gcc-4.4 -Wall -O2 */
/**
diff --git a/pjlib/src/pj/log.c b/pjlib/src/pj/log.c
index bb808dac..6f0a5ef4 100644
--- a/pjlib/src/pj/log.c
+++ b/pjlib/src/pj/log.c
@@ -107,7 +107,7 @@ static void log_set_indent(int indent)
pj_thread_local_set(thread_indent_tls_id, (void*)(pj_ssize_t)indent);
}
-static int log_get_raw_indent()
+static int log_get_raw_indent(void)
{
return (long)(pj_ssize_t)pj_thread_local_get(thread_indent_tls_id);
}
@@ -119,13 +119,13 @@ static void log_set_indent(int indent)
if (log_indent < 0) log_indent = 0;
}
-static int log_get_raw_indent()
+static int log_get_raw_indent(void)
{
return log_indent;
}
#endif /* PJ_LOG_ENABLE_INDENT && PJ_HAS_THREADS */
-static int log_get_indent()
+static int log_get_indent(void)
{
int indent = log_get_raw_indent();
return indent > LOG_MAX_INDENT ? LOG_MAX_INDENT : indent;
diff --git a/pjlib/src/pj/pool_buf.c b/pjlib/src/pj/pool_buf.c
index 13940d47..bf36b0e0 100644
--- a/pjlib/src/pj/pool_buf.c
+++ b/pjlib/src/pj/pool_buf.c
@@ -43,7 +43,7 @@ static void pool_buf_cleanup(void)
is_initialized = 0;
}
-static pj_status_t pool_buf_initialize()
+static pj_status_t pool_buf_initialize(void)
{
pj_atexit(&pool_buf_cleanup);
diff --git a/pjlib/src/pj/ssl_sock_ossl.c b/pjlib/src/pj/ssl_sock_ossl.c
index 7c2b8461..7129f21f 100644
--- a/pjlib/src/pj/ssl_sock_ossl.c
+++ b/pjlib/src/pj/ssl_sock_ossl.c
@@ -610,8 +610,8 @@ static pj_status_t create_ssl(pj_ssl_sock_t *ssock)
/* Setup SSL BIOs */
ssock->ossl_rbio = BIO_new(BIO_s_mem());
ssock->ossl_wbio = BIO_new(BIO_s_mem());
- BIO_set_close(ssock->ossl_rbio, BIO_CLOSE);
- BIO_set_close(ssock->ossl_wbio, BIO_CLOSE);
+ (void)BIO_set_close(ssock->ossl_rbio, BIO_CLOSE);
+ (void)BIO_set_close(ssock->ossl_wbio, BIO_CLOSE);
SSL_set_bio(ssock->ossl_ssl, ssock->ossl_rbio, ssock->ossl_wbio);
return PJ_SUCCESS;
@@ -1273,7 +1273,7 @@ static pj_status_t flush_write_bio(pj_ssl_sock_t *ssock,
pj_memcpy(&wdata->data, data, len);
/* Reset write BIO */
- BIO_reset(ssock->ossl_wbio);
+ (void)BIO_reset(ssock->ossl_wbio);
/* Ticket #1573: Don't hold mutex while calling PJLIB socket send(). */
pj_lock_release(ssock->write_mutex);