Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8224028

loop initial declarations introduced by JDK-8184770

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1
    • 13
    • 13
    • core-svc
    • None
    • b22
    • Verified

    Description

      Loop initial declarations are only allowed in C99 mode.

      $ make images CONF=linux-x86_64-server-release
      Building target 'images' in configuration 'linux-x86_64-server-release'
      Compiling 3014 files for java.base
      Updating support/modules_libs/java.base/server/libjvm.so due to 7 file(s)
      Compiling 251 files for jdk.jdi
      Compiling 2781 files for java.desktop
      Updating support/src.zip
      Updating support/modules_libs/java.base/libjava.so due to 2 file(s)
      Updating support/modules_libs/java.base/libnet.so due to 1 file(s)
      Updating support/modules_libs/jdk.jdwp.agent/libdt_socket.so due to 2 file(s)
      Updating images/sec-bin.zip
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'parseAllowedMask':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:422:5: error: 'for' loop initial declarations are only allowed in C99 mode
           for (int i = 0; prefixLen > 0; i++, prefixLen -= 8) {
           ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:422:5: note: use option -std=c99 or -std=gnu99 to compile your code
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'parseAllowedPeersInternal':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:481:13: error: 'for' loop initial declarations are only allowed in C99 mode
                   for (size_t i = 0; i < sizeof(_peers[_peers_cnt].subnet); i++) {
                   ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'isAddressInSubnet':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:524:5: error: 'for' loop initial declarations are only allowed in C99 mode
           for (size_t i = 0; i < sizeof(struct in6_addr); i++) {
           ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'isPeerAllowed':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:544:5: error: 'for' loop initial declarations are only allowed in C99 mode
           for (int i = 0; i < _peers_cnt; ++i) {
           ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'socketTransport_startListening':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:652:5: error: 'for' loop initial declarations are only allowed in C99 mode
           for (int pass = 0; pass < 2 && listenAddr == NULL; pass++) {
           ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:653:9: error: 'for' loop initial declarations are only allowed in C99 mode
               for (struct addrinfo *ai = addrInfo; ai != NULL; ai = ai->ai_next) {
               ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'socketTransport_attach':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:875:5: error: 'for' loop initial declarations are only allowed in C99 mode
           for (int pass = 0; pass < 2 && socketFD < 0; pass++) {
           ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:876:9: error: 'for' loop initial declarations are only allowed in C99 mode
               for (struct addrinfo *ai = addrInfo; ai != NULL; ai = ai->ai_next) {
               ^
      gmake[3]: *** [/home/aoqi/jdk/build/linux-x86_64-server-release/support/native/jdk.jdwp.agent/libdt_socket/socketTransport.o] Error 1
      gmake[3]: *** Waiting for unfinished jobs....
      gmake[2]: *** [jdk.jdwp.agent-libs] Error 1
      gmake[2]: *** Waiting for unfinished jobs....

      ERROR: Build failed for target 'images' in configuration 'linux-x86_64-server-release' (exit code 2)
      Stopping sjavac server

      === Output from failing command(s) repeated here ===
      * For target support_native_jdk.jdwp.agent_libdt_socket_socketTransport.o:
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'parseAllowedMask':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:422:5: error: 'for' loop initial declarations are only allowed in C99 mode
           for (int i = 0; prefixLen > 0; i++, prefixLen -= 8) {
           ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:422:5: note: use option -std=c99 or -std=gnu99 to compile your code
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'parseAllowedPeersInternal':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:481:13: error: 'for' loop initial declarations are only allowed in C99 mode
                   for (size_t i = 0; i < sizeof(_peers[_peers_cnt].subnet); i++) {
                   ^
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function 'isAddressInSubnet':
      /home/aoqi/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:524:5: error: 'for' loop initial declarations are only allowed in C99 mode
           for (size_t i = 0; i < sizeof(struct in6_addr); i++) {
         ... (rest of output omitted)

      * All command lines available in /home/aoqi/jdk/build/linux-x86_64-server-release/make-support/failure-logs.
      === End of repeated output ===

      No indication of failed target found.
      Hint: Try searching the build log for '] Error'.
      Hint: See doc/building.html#troubleshooting for assistance.

      make[1]: *** [main] Error 1

      Attachments

        Issue Links

          Activity

            People

              aoqi Qi Ao
              aoqi Qi Ao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: