[exim-cvs] Remove attempts to quieten compiler static-checki…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] Remove attempts to quieten compiler static-checking (more)
Gitweb: https://git.exim.org/exim.git/commitdiff/2bde51964df7b459f1cc6853ffa7f5466d02554f
Commit:     2bde51964df7b459f1cc6853ffa7f5466d02554f
Parent:     f15b0e22422af2e14091e0ac6a58454b6849cba6
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Jun 28 14:16:20 2020 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Jun 28 14:16:20 2020 +0100


        Remove attempts to quieten compiler static-checking (more)
---
 src/src/acl.c               |  2 --
 src/src/auths/auth-spa.c    |  2 --
 src/src/dbfn.c              |  1 -
 src/src/debug.c             |  2 +-
 src/src/dns.c               |  3 +--
 src/src/exim.c              | 12 +++++-------
 src/src/exim_dbutil.c       |  1 -
 src/src/filtertest.c        |  2 +-
 src/src/ip.c                |  4 ----
 src/src/log.c               |  5 +----
 src/src/match.c             |  4 ----
 src/src/routers/ipliteral.c |  1 -
 src/src/smtp_in.c           |  4 +---
 src/src/spool_mbox.c        |  3 +--
 src/src/tls-openssl.c       |  1 -
 src/src/transport.c         |  1 -
 src/src/transports/pipe.c   |  7 -------
 src/src/transports/smtp.c   |  1 -
 18 files changed, 11 insertions(+), 45 deletions(-)


diff --git a/src/src/acl.c b/src/src/acl.c
index 1bb0cbb..8e17a0e 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -1186,8 +1186,6 @@ acl_verify_reverse(uschar **user_msgptr, uschar **log_msgptr)
{
int rc;

-user_msgptr = user_msgptr; /* stop compiler warning */
-
/* Previous success */

if (sender_host_name != NULL) return OK;
diff --git a/src/src/auths/auth-spa.c b/src/src/auths/auth-spa.c
index 44c99e9..583a2b9 100644
--- a/src/src/auths/auth-spa.c
+++ b/src/src/auths/auth-spa.c
@@ -1395,8 +1395,6 @@ int i;
int p = (int)getpid();
int random_seed = (int)time(NULL) ^ ((p << 16) | p);

-request = request; /* Added by PH to stop compilers whinging */
-
/* Ensure challenge data is cleared, in case it isn't all used. This
patch added by PH on suggestion of Russell King */

diff --git a/src/src/dbfn.c b/src/src/dbfn.c
index bbf20a1..aa08320 100644
--- a/src/src/dbfn.c
+++ b/src/src/dbfn.c
@@ -423,7 +423,6 @@ dbfn_scan(open_db *dbblock, BOOL start, EXIM_CURSOR **cursor)
 {
 EXIM_DATUM key_datum, value_datum;
 uschar *yield;
-value_datum = value_datum;    /* dummy; not all db libraries use this */


DEBUG(D_hints_lookup) debug_printf_indent("dbfn_scan\n");

diff --git a/src/src/debug.c b/src/src/debug.c
index 3a7d6a6..44e0cee 100644
--- a/src/src/debug.c
+++ b/src/src/debug.c
@@ -332,7 +332,7 @@ if (fstat(fd, &s) == 0 && (s.st_mode & S_IFMT) == S_IFSOCK)
socklen_t alen = sizeof(a);
struct sockaddr_in * sinp = (struct sockaddr_in *)&a;
struct sockaddr_in6 * sin6p = (struct sockaddr_in6 *)&a;
- struct sockaddr_un * sa_unp ; (struct sockaddr_un *)&a;
+ struct sockaddr_un * sa_unp = (struct sockaddr_un *)&a;

   if (getsockname(fd, &a, &alen) == 0)
     switch (sinp->sin_family)
diff --git a/src/src/dns.c b/src/src/dns.c
index b567c3e..98c44b9 100644
--- a/src/src/dns.c
+++ b/src/src/dns.c
@@ -334,7 +334,6 @@ char * trace = NULL;
 #ifdef rr_trace
 # define TRACE DEBUG(D_dns)
 #else
-trace = trace;
 # define TRACE if (FALSE)
 #endif


@@ -1249,7 +1248,7 @@ switch (type)

     /* Extract the numerical SRV fields (p is incremented) */
     GETSHORT(priority, p);
-    GETSHORT(weight, p);    weight = weight; /* compiler quietening */
+    GETSHORT(weight, p);
     GETSHORT(port, p);


     /* Check the CSA version number */
diff --git a/src/src/exim.c b/src/src/exim.c
index dcfc066..9d3d456 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -53,7 +53,7 @@ return store_get((int)size, TRUE);
 }


static void
-function_dummy_free(void *block) { block = block; }
+function_dummy_free(void * block) {}

static void *
function_store_malloc(size_t size)
@@ -62,7 +62,7 @@ return store_malloc((int)size);
}

static void
-function_store_free(void *block)
+function_store_free(void * block)
{
store_free(block);
}
@@ -4101,10 +4101,8 @@ privilege by now. Before the chdir, we try to ensure that the directory exists.

 if (Uchdir(spool_directory) != 0)
   {
-  int dummy;
-  (void)directory_make(spool_directory, US"", SPOOL_DIRECTORY_MODE, FALSE);
-  dummy = /* quieten compiler */ Uchdir(spool_directory);
-  dummy = dummy;    /* yet more compiler quietening, sigh */
+  (void) directory_make(spool_directory, US"", SPOOL_DIRECTORY_MODE, FALSE);
+  (void) Uchdir(spool_directory);
   }


/* Handle calls with the -bi option. This is a sendmail option to rebuild *the*
@@ -4115,7 +4113,7 @@ script. */

 if (bi_option)
   {
-  (void)fclose(config_file);
+  (void) fclose(config_file);
   if (bi_command && *bi_command)
     {
     int i = 0;
diff --git a/src/src/exim_dbutil.c b/src/src/exim_dbutil.c
index 8513bc0..7429527 100644
--- a/src/src/exim_dbutil.c
+++ b/src/src/exim_dbutil.c
@@ -515,7 +515,6 @@ dbfn_scan(open_db *dbblock, BOOL start, EXIM_CURSOR **cursor)
 {
 EXIM_DATUM key_datum, value_datum;
 uschar *yield;
-value_datum = value_datum;    /* dummy; not all db libraries use this */


/* Some dbm require an initialization */

diff --git a/src/src/filtertest.c b/src/src/filtertest.c
index f54cbef..a2a60a8 100644
--- a/src/src/filtertest.c
+++ b/src/src/filtertest.c
@@ -95,7 +95,7 @@ if (!dot_ended && !feof(stdin))
       if (s > message_body_end + message_body_visible) s = message_body_end;
       message_size++;
       }
-    READ_END: ch = ch;  /* Some compilers don't like null statements */
+    READ_END: ;
     }
   if (s == message_body_end || s[-1] != '\n') body_linecount++;
   }
diff --git a/src/src/ip.c b/src/src/ip.c
index a5958e9..c09962a 100644
--- a/src/src/ip.c
+++ b/src/src/ip.c
@@ -127,8 +127,6 @@ if (af == AF_INET6)
   return sizeof(sin->v6);
   }
 else
-#else     /* HAVE_IPv6 */
-af = af;  /* Avoid compiler warning */
 #endif    /* HAVE_IPV6 */


 /* Setup code when using IPv4 socket. The wildcard address is "". */
@@ -209,8 +207,6 @@ if (af == AF_INET6)
   s_len = sizeof(s_in6);
   }
 else
-#else     /* HAVE_IPV6 */
-af = af;  /* Avoid compiler warning */
 #endif    /* HAVE_IPV6 */


 /* For an IPv4 address, use an IPv4 sockaddr structure, even on a system with
diff --git a/src/src/log.c b/src/src/log.c
index 99eba5f..9f3f45e 100644
--- a/src/src/log.c
+++ b/src/src/log.c
@@ -1188,10 +1188,7 @@ if (flags & LOG_PANIC)
     panic_recurseflag = FALSE;


     if (panic_save_buffer)
-      {
-      int i = write(paniclogfd, panic_save_buffer, Ustrlen(panic_save_buffer));
-      i = i;    /* compiler quietening */
-      }
+      (void) write(paniclogfd, panic_save_buffer, Ustrlen(panic_save_buffer));


     written_len = write_to_fd_buf(paniclogfd, g->s, g->ptr);
     if (written_len != g->ptr)
diff --git a/src/src/match.c b/src/src/match.c
index 2f6c922..18de977 100644
--- a/src/src/match.c
+++ b/src/src/match.c
@@ -104,8 +104,6 @@ uschar *filename = NULL;
 uschar *keyquery, *result, *semicolon;
 void *handle;


-error = error; /* Keep clever compilers from complaining */
-
if (valueptr) *valueptr = NULL;

/* For regular expressions, use cb->origsubject rather than cb->subject so that
@@ -1004,8 +1002,6 @@ uschar *subject = cb->address;
const uschar *s;
uschar *pdomain, *sdomain;

-error = error; /* Keep clever compilers from complaining */
-
DEBUG(D_lists) debug_printf("address match test: subject=%s pattern=%s\n",
subject, pattern);

diff --git a/src/src/routers/ipliteral.c b/src/src/routers/ipliteral.c
index f0b3b19..09775ed 100644
--- a/src/src/routers/ipliteral.c
+++ b/src/src/routers/ipliteral.c
@@ -57,7 +57,6 @@ ipliteral_router_init(router_instance *rblock)
ipliteral_router_options_block *ob =
(ipliteral_router_options_block *)(rblock->options_block);
*/
-rblock = rblock;
}


diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 39f5199..ef3964f 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -4497,10 +4497,8 @@ while (done <= 0)
 # endif
       else
 #endif
+    (void) fwrite(g->s, 1, g->ptr, smtp_out);


-    {
-    int i = fwrite(g->s, 1, g->ptr, smtp_out); i = i; /* compiler quietening */
-    }
       DEBUG(D_receive)
     {
     uschar *cr;
diff --git a/src/src/spool_mbox.c b/src/src/spool_mbox.c
index 4f3c4d2..9f1efbf 100644
--- a/src/src/spool_mbox.c
+++ b/src/src/spool_mbox.c
@@ -226,12 +226,11 @@ if (spool_mbox_ok && !f.no_mbox_unspool)
   for (struct dirent *entry; entry = readdir(tempdir); )
     {
     uschar *name = US entry->d_name;
-    int dummy;
     if (Ustrcmp(name, US".") == 0 || Ustrcmp(name, US"..") == 0) continue;


     file_path = string_sprintf("%s/%s", mbox_path, name);
     debug_printf("unspool_mbox(): unlinking '%s'\n", file_path);
-    dummy = unlink(CS file_path); dummy = dummy;    /* compiler quietening */
+    (void) unlink(CS file_path);
     }


closedir(tempdir);
diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c
index 525afd6..50384cb 100644
--- a/src/src/tls-openssl.c
+++ b/src/src/tls-openssl.c
@@ -496,7 +496,6 @@ RSA *rsa_key;
BIGNUM *bn = BN_new();
#endif

-export = export;     /* Shut picky compilers up */
 DEBUG(D_tls) debug_printf("Generating %d bit RSA key...\n", keylength);


 #ifdef EXIM_HAVE_RSA_GENKEY_EX
diff --git a/src/src/transport.c b/src/src/transport.c
index f9ff521..aed743d 100644
--- a/src/src/transport.c
+++ b/src/src/transport.c
@@ -1400,7 +1400,6 @@ if (write_pid > 0)
     int dummy = read(pfd[pipe_read], (void *)&save_errno, sizeof(int));
         dummy = read(pfd[pipe_read], (void *)&tctx->addr->more_errno, sizeof(int));
         dummy = read(pfd[pipe_read], (void *)&tctx->addr->delivery_time, sizeof(struct timeval));
-    dummy = dummy;        /* compiler quietening */
         yield = FALSE;
         }
       }
diff --git a/src/src/transports/pipe.c b/src/src/transports/pipe.c
index 27422bd..1cb574e 100644
--- a/src/src/transports/pipe.c
+++ b/src/src/transports/pipe.c
@@ -144,13 +144,6 @@ pipe_transport_setup(transport_instance *tblock, address_item *addrlist,
 pipe_transport_options_block *ob =
   (pipe_transport_options_block *)(tblock->options_block);


-addrlist = addrlist;  /* Keep compiler happy */
-dummy = dummy;
-uid = uid;
-gid = gid;
-errmsg = errmsg;
-ob = ob;
-
 #ifdef HAVE_SETCLASSRESOURCES
 if (ob->use_classresources)
   {
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 0f3ade9..46663b0 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -3428,7 +3428,6 @@ uschar *message = NULL;
 uschar new_message_id[MESSAGE_ID_LENGTH + 1];
 smtp_context * sx = store_get(sizeof(*sx), TRUE);    /* tainted, for the data buffers */


-suppress_tls = suppress_tls; /* stop compiler warning when no TLS support */
*message_defer = FALSE;

memset(sx, 0, sizeof(*sx));