[exim-cvs] silence various compiler complaints; expose NVALG…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Exim Git Commits Mailing List
Data:  
Para: exim-cvs
Asunto: [exim-cvs] silence various compiler complaints; expose NVALGRIND
Gitweb: http://git.exim.org/exim.git/commitdiff/438257ba19880f95172493e5f6fede1e1517c309
Commit:     438257ba19880f95172493e5f6fede1e1517c309
Parent:     2ff4a98a5fa50522b88c892318c46e769e0182cc
Author:     Phil Pennock <pdp@???>
AuthorDate: Fri May 4 13:25:49 2012 -0700
Committer:  Phil Pennock <pdp@???>
CommitDate: Fri May 4 13:25:49 2012 -0700


    silence various compiler complaints; expose NVALGRIND
---
 src/src/EDITME                  |    6 ++++++
 src/src/acl.c                   |   12 ++++++------
 src/src/auths/cram_md5.c        |    4 ++--
 src/src/auths/heimdal_gssapi.c  |    2 +-
 src/src/config.h.defaults       |    2 ++
 src/src/store.c                 |    5 ++++-
 src/src/transports/tf_maildir.c |    2 +-
 7 files changed, 22 insertions(+), 11 deletions(-)


diff --git a/src/src/EDITME b/src/src/EDITME
index c4aedb6..f247f44 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -1199,6 +1199,12 @@ TMPDIR="/tmp"


 #------------------------------------------------------------------------------
+# 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
 # file can be specified here. Some installations may want something like this:
diff --git a/src/src/acl.c b/src/src/acl.c
index 50d5d85..3cafd81 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 31de7c2..e93d038 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 e01789e..c6e973a 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 f3e3d88..c082b92 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 1d1458d..0a5a11f 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 66760d1..8e57d28 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)