[tor-commits] [tor/master] Tell autoconf to make the compiler act as c99

nickm at torproject.org nickm at torproject.org
Fri Sep 26 15:15:33 UTC 2014


commit b0767e85b8214677b7989723e55fbbf3ce24f3f2
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Sep 25 11:36:28 2014 -0400

    Tell autoconf to make the compiler act as c99
    
    Apparently some compilers want extra switches.
---
 configure.ac         |    1 +
 src/common/address.c |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 15154b3..4162158 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,6 +191,7 @@ AM_CONDITIONAL(USE_FW_HELPER, test x$natpmp = xtrue || test x$upnp = xtrue)
 AM_CONDITIONAL(NAT_PMP, test x$natpmp = xtrue)
 AM_CONDITIONAL(MINIUPNPC, test x$upnp = xtrue)
 AM_PROG_CC_C_O
+AC_PROG_CC_C99
 
 AC_ARG_VAR(PYTHON)
 AC_CHECK_PROGS(PYTHON, [python python2 python2.7 python3 python3.3])
diff --git a/src/common/address.c b/src/common/address.c
index f79736d..07b7659 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -471,7 +471,6 @@ tor_addr_parse_PTR_name(tor_addr_t *result, const char *address,
 
   if (!strcasecmpend(address, ".ip6.arpa")) {
     const char *cp;
-    int i;
     int n0, n1;
     struct in6_addr in6;
 
@@ -479,7 +478,7 @@ tor_addr_parse_PTR_name(tor_addr_t *result, const char *address,
       return -1;
 
     cp = address;
-    for (i = 0; i < 16; ++i) {
+    for (int i = 0; i < 16; ++i) {
       n0 = hex_decode_digit(*cp++); /* The low-order nybble appears first. */
       if (*cp++ != '.') return -1;  /* Then a dot. */
       n1 = hex_decode_digit(*cp++); /* The high-order nybble appears first. */





More information about the tor-commits mailing list