[MacPorts] #57971: nss @3.41.1 does not build on PPC Tiger, Mac OS X 10.4.11, because "'for' loop initial declaration used outside C99 mode"

MacPorts noreply at macports.org
Sun Jan 27 20:40:06 UTC 2019


#57971: nss @3.41.1 does not build on PPC Tiger, Mac OS X 10.4.11, because "'for'
loop initial declaration used outside C99 mode"
-----------------------+--------------------
 Reporter:  ballapete  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:  2.5.4
 Keywords:  tiger      |       Port:  nss
-----------------------+--------------------
 {{{
 /opt/local/bin/gcc-apple-4.2 -arch ppc -o Output.OBJD/tls13esni.o -c -Os
 -fPIC -Dppc -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK
 -Wall -Wshadow -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG
 -DNSS_NO_INIT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT
 -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I/opt/local/include/nspr
 -I../../../dist/Output.OBJD/include -I../../../dist/public/nss
 -I../../../dist/private/nss  tls13esni.c
 tls13esni.c: In function 'tls13_CopyESNIKeys':
 tls13esni.c:72: error: 'for' loop initial declaration used outside C99
 mode
 tls13esni.c: In function 'SSLExp_EncodeESNIKeys':
 tls13esni.c:288: error: 'for' loop initial declaration used outside C99
 mode
 make[2]: *** [Output.OBJD/tls13esni.o] Error 1
 make[2]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/nss-3.41.1/nss/lib/ssl'
 }}}

 First case is this loop:

 {{{
    71       for (PRCList *cur_p = PR_LIST_HEAD(&okeys->keyShares);
    72            cur_p != &okeys->keyShares;
    73            cur_p = PR_NEXT_LINK(cur_p)) {
    74           TLS13KeyShareEntry *copy = tls13_CopyKeyShareEntry(
    75               (TLS13KeyShareEntry *)cur_p);
    76           if (!copy) {
    77               goto loser;
    78           }
    79           PR_APPEND_LINK(&copy->link, &nkeys->keyShares);
    80       }
 }}}

 and second case is this loop:

 {{{
   288       for (unsigned int i = 0; i < cipherSuiteCount; i++) {
   289           rv = sslBuffer_AppendNumber(&b, cipherSuites[i], 2);
   290           if (rv != SECSuccess) {
   291               goto loser;
   292           }
   293       }
 }}}

 In the first case the C pre-processor produces

 {{{
     for (PRCList *cur_p = (&okeys->keyShares)->next;
          cur_p != &okeys->keyShares;
          cur_p = ((cur_p)->next)) {
         TLS13KeyShareEntry *copy = tls13_CopyKeyShareEntry(
             (TLS13KeyShareEntry *)cur_p);
         if (!copy) {
             goto loser;
         }
         do { (&copy->link)->next = (&nkeys->keyShares);
 (&copy->link)->prev = (&nkeys->keyShares)->prev;
 (&nkeys->keyShares)->prev->next = (&copy->link); (&nkeys->keyShares)->prev
 = (&copy->link); } while (0);
     }
 }}}

 and in the second case:

 {{{
     for (unsigned int i = 0; i < cipherSuiteCount; i++) {
         rv = sslBuffer_AppendNumber(&b, cipherSuites[i], 2);
         if (rv != SECSuccess) {
             goto loser;
         }
     }
 }}}

 The fault seems to be that neither cur_p nor i are declared before and
 outside the loop declarations…

-- 
Ticket URL: <https://trac.macports.org/ticket/57971>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list