Silence miscellaneous 64-to-32-bit data loss warnings.

This commit is contained in:
Jason Evans 2016-02-24 13:16:51 -08:00
parent b3d0070b14
commit ca8fffb5c1
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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