[exim-cvs] Moved variable decl to start of block for old gcc

Góra strony
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
Dla: exim-cvs
Temat: [exim-cvs] Moved variable decl to start of block for old gcc
Gitweb: http://git.exim.org/exim.git/commitdiff/2e64baa9d155c1a657ba43cbe0f9bd4846621b36
Commit:     2e64baa9d155c1a657ba43cbe0f9bd4846621b36
Parent:     4c9ef03a1e4b4aaab82bc2636b59b4a18031d02f
Author:     Nigel Metheringham <nigel@???>
AuthorDate: Mon Feb 21 12:53:04 2011 +0000
Committer:  Nigel Metheringham <nigel@???>
CommitDate: Mon Feb 21 12:53:04 2011 +0000


    Moved variable decl to start of block for old gcc
---
 doc/doc-txt/ChangeLog |    4 ++++
 src/src/spam.c        |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 5646a14..04b643f 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -72,6 +72,10 @@ PP/13 Bugzilla 1086: Deal with maildir quota file races.
 PP/14 Bugzilla 1019: DKIM multiple signature generation fix.
       Patch from Uwe Doering, sign-off by Michael Haardt.


+NM/05 Fix to spam.c to accommodate older gcc versions which dislike
+      variable declaration deep within a block.  Bug and patch from
+      Dennis Davis.
+


 Exim version 4.74
 -----------------
diff --git a/src/src/spam.c b/src/src/spam.c
index 55999a3..3d38d99 100644
--- a/src/src/spam.c
+++ b/src/src/spam.c
@@ -150,6 +150,7 @@ int spam(uschar **listptr) {
     };


     while ( num_servers > 0 ) {
+      int i;


       /* Randomly pick a server to try */
       current_server = random_number( num_servers );
@@ -185,7 +186,6 @@ int spam(uschar **listptr) {


       /* Remove the server from the list. XXX We should free the memory */
       num_servers--;
-      int i;
       for( i = current_server; i < num_servers; i++ )
         spamd_address_vector[i] = spamd_address_vector[i+1];
     }