From d1ee38fec1c72878816bb8cc20d63a4dea6a4ca3 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Thu, 23 Jul 2015 14:57:04 -0700 Subject: Fix compiler type warnings. (closes #3765) The output of mutt_local_tz() was being passed to abs(). Technically the return type is time_t, but it represents a small value: the timezone offset in seconds. Add a safe explicit cast to int. Change the txt parameter of mutt_make_help() to type const char *. Typically all calls run the txt parameter through _(), which accepts const char * and returns a char *. However, if NLS is not enabled, _() is a noop, simply returning the parameter itself. In mutt_compile_help(), items[i].name is const char *, so it will generate a warning when passed as the txt parameter of mutt_make_help(). On some systems, e.g. OS X, snprintf is defined as a macro. One call in hcache.c was embedding directives inside the snprintf call. This is apparently undefined behavior, so duplicate the call instead. --- imap/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'imap') diff --git a/imap/util.c b/imap/util.c index 6295c5ff..c05465a3 100644 --- a/imap/util.c +++ b/imap/util.c @@ -591,7 +591,7 @@ void imap_make_date (char *buf, time_t timestamp) snprintf (buf, IMAP_DATELEN, "%02d-%s-%d %02d:%02d:%02d %+03d%02d", tm->tm_mday, Months[tm->tm_mon], tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec, - (int) tz / 60, (int) abs (tz) % 60); + (int) tz / 60, (int) abs ((int) tz) % 60); } /* imap_qualify_path: make an absolute IMAP folder target, given IMAP_MBOX -- cgit v1.2.3