From: Phil Pennock Date: Fri, 4 May 2012 20:25:49 +0000 (-0700) Subject: silence various compiler complaints; expose NVALGRIND X-Git-Tag: exim-4_80_RC1~40^2~2 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/438257ba19880f95172493e5f6fede1e1517c309?hp=2ff4a98a5fa50522b88c892318c46e769e0182cc silence various compiler complaints; expose NVALGRIND --- diff --git a/src/src/EDITME b/src/src/EDITME index c4aedb6bd..f247f44a9 100644 --- a/src/src/EDITME +++ b/src/src/EDITME @@ -1198,6 +1198,12 @@ TMPDIR="/tmp" # PERL_LIBS= +#------------------------------------------------------------------------------ +# If you wish to disable valgrind in the binary, define NVALGRIND=1. +# This should not be needed. + +# NVALGRIND=1 + #------------------------------------------------------------------------------ # Identifying the daemon: When an Exim daemon starts up, it writes its pid # (process id) to a file so that it can easily be identified. The path of the diff --git a/src/src/acl.c b/src/src/acl.c index 50d5d8594..3cafd8184 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -992,7 +992,7 @@ for (p = q = hstring; *p != 0; ) if (*s == ':' || !isgraph(*s)) break; } - s = string_sprintf("%s%.*s", (*s == ':')? "" : "X-ACL-Warn: ", q - p, p); + s = string_sprintf("%s%.*s", (*s == ':')? "" : "X-ACL-Warn: ", (int) (q - p), p); hlen = Ustrlen(s); /* See if this line has already been added */ @@ -1723,16 +1723,16 @@ while ((ss = string_nextinlist(&list, &sep, big_buffer, big_buffer_size)) != NULL) { callout_opt_t * op; - double period; + double period = 1.0F; for (op= callout_opt_list; op->name; op++) - if (strncmpic(opt, op->name, strlen(op->name)) == 0) + if (strncmpic(opt, op->name, Ustrlen(op->name)) == 0) break; verify_options |= op->flag; if (op->has_option) { - opt += strlen(op->name); + opt += Ustrlen(op->name); while (isspace(*opt)) opt++; if (*opt++ != '=') { @@ -2093,7 +2093,7 @@ uschar buffer[STRING_SPRINTF_BUFFER_SIZE]; va_start(ap, format); if (!string_vformat(buffer, sizeof(buffer), format, ap)) log_write(0, LOG_MAIN|LOG_PANIC_DIE, - "string_sprintf expansion was longer than %d", sizeof(buffer)); + "string_sprintf expansion was longer than %ld", sizeof(buffer)); va_end(ap); *log_msgptr = string_sprintf( "error in arguments to \"ratelimit\" condition: %s", buffer); @@ -2228,7 +2228,7 @@ while ((ss = string_nextinlist(&arg, &sep, big_buffer, big_buffer_size)) else if (strcmpic(ss, US"per_addr") == 0) { RATE_SET(mode, PER_RCPT); - if (where != ACL_WHERE_RCPT) badacl = TRUE, unique = "*"; + if (where != ACL_WHERE_RCPT) badacl = TRUE, unique = US"*"; else unique = string_sprintf("%s@%s", deliver_localpart, deliver_domain); } else if (strncmpic(ss, US"count=", 6) == 0) diff --git a/src/src/auths/cram_md5.c b/src/src/auths/cram_md5.c index 31de7c2d2..e93d03845 100644 --- a/src/src/auths/cram_md5.c +++ b/src/src/auths/cram_md5.c @@ -153,8 +153,8 @@ auth_cram_md5_server(auth_instance *ablock, uschar *data) { auth_cram_md5_options_block *ob = (auth_cram_md5_options_block *)(ablock->options_block); -uschar *challenge = string_sprintf("<%d.%d@%s>", getpid(), time(NULL), - primary_hostname); +uschar *challenge = string_sprintf("<%d.%ld@%s>", getpid(), + (long int) time(NULL), primary_hostname); uschar *clear, *secret; uschar digest[16]; int i, rc, len; diff --git a/src/src/auths/heimdal_gssapi.c b/src/src/auths/heimdal_gssapi.c index e01789e31..c6e973ad9 100644 --- a/src/src/auths/heimdal_gssapi.c +++ b/src/src/auths/heimdal_gssapi.c @@ -526,7 +526,7 @@ exim_gssapi_error_defer(uschar *store_reset_point, va_start(ap, format); if (!string_vformat(buffer, sizeof(buffer), format, ap)) log_write(0, LOG_MAIN|LOG_PANIC_DIE, - "exim_gssapi_error_defer expansion larger than %d", + "exim_gssapi_error_defer expansion larger than %lu", sizeof(buffer)); va_end(ap); diff --git a/src/src/config.h.defaults b/src/src/config.h.defaults index f3e3d880a..c082b9269 100644 --- a/src/src/config.h.defaults +++ b/src/src/config.h.defaults @@ -101,6 +101,8 @@ it's a default value. */ #define MAX_NAMED_LIST 16 #define MSGLOG_DIRECTORY_MODE 0750 +#define NVALGRIND + #define PID_FILE_PATH #define RADIUS_CONFIG_FILE diff --git a/src/src/store.c b/src/src/store.c index 1d1458d0f..0a5a11fc2 100644 --- a/src/src/store.c +++ b/src/src/store.c @@ -39,6 +39,9 @@ The following different types of store are recognized: #include "exim.h" +/* keep config.h before memcheck.h, for NVALGRIND */ +#include "config.h" + #include "memcheck.h" @@ -342,7 +345,7 @@ if ((char *)ptr < bc || (char *)ptr > bc + b->length) if ((char *)ptr >= bc && (char *)ptr <= bc + b->length) break; } if (b == NULL) - log_write(0, LOG_MAIN|LOG_PANIC_DIE, "internal error: store_reset(%d) " + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "internal error: store_reset(%p) " "failed: pool=%d %-14s %4d", ptr, store_pool, filename, linenumber); } diff --git a/src/src/transports/tf_maildir.c b/src/src/transports/tf_maildir.c index 66760d1b0..8e57d28b2 100644 --- a/src/src/transports/tf_maildir.c +++ b/src/src/transports/tf_maildir.c @@ -555,7 +555,7 @@ else (void)gettimeofday(&tv, NULL); tempname = string_sprintf("%s/tmp/%lu.H%luP%lu.%s", path, tv.tv_sec, - tv.tv_usec, getpid(), primary_hostname); + tv.tv_usec, (long unsigned) getpid(), primary_hostname); fd = Uopen(tempname, O_RDWR|O_CREAT|O_EXCL, ob->mode ? ob->mode : 0600); if (fd >= 0)