summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-02-24 21:16:51 (GMT)
committerJason Evans <jasone@canonware.com>2016-02-24 21:16:51 (GMT)
commitca8fffb5c13b6a7c45fd034667a8910c61d09c3b (patch)
treea6d981c63455e782bb43c6d1a5ba1d39d21f58d8
parentb3d0070b1495ddd36893d481c512b5da1ab8acef (diff)
downloadjemalloc-ca8fffb5c13b6a7c45fd034667a8910c61d09c3b.zip
jemalloc-ca8fffb5c13b6a7c45fd034667a8910c61d09c3b.tar.gz
jemalloc-ca8fffb5c13b6a7c45fd034667a8910c61d09c3b.tar.bz2
Silence miscellaneous 64-to-32-bit data loss warnings.
-rw-r--r--src/prof.c2
-rw-r--r--src/util.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/prof.c b/src/prof.c
index 173da69..93421ab 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -989,7 +989,7 @@ prof_dump_close(bool propagate_err)
static bool
prof_dump_write(bool propagate_err, const char *s)
{
- unsigned i, slen, n;
+ size_t i, slen, n;
cassert(config_prof);
diff --git a/src/util.c b/src/util.c
index d519818..9aaa806 100644
--- a/src/util.c
+++ b/src/util.c
@@ -53,8 +53,12 @@ wrtmessage(void *cbopaque, const char *s)
* Use syscall(2) rather than write(2) when possible in order to avoid
* the possibility of memory allocation within libc. This is necessary
* on FreeBSD; most operating systems do not have this problem though.
+ *
+ * syscall() returns long or int, depending on platform, so capture the
+ * unused result in the widest plausible type to avoid compiler
+ * warnings.
*/
- UNUSED int result = syscall(SYS_write, STDERR_FILENO, s, strlen(s));
+ UNUSED long result = syscall(SYS_write, STDERR_FILENO, s, strlen(s));
#else
UNUSED int result = write(STDERR_FILENO, s, strlen(s));
#endif