JDK-8224028 : loop initial declarations introduced by JDK-8184770
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 13
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-05-16
  • Updated: 2019-08-05
  • Resolved: 2019-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b22Fixed
Related Reports
Duplicate :  
Relates :  
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

Comments
The build passed
05-08-2019

Finally passed tier1 locally for me.
17-05-2019

Hi Aleksey, could you help to push? Thanks.
17-05-2019

Ok! Checked. They are same. Thanks!
17-05-2019

Let me push it for you then? Please check this changeset (it is webrev.01): http://cr.openjdk.java.net/~shade/8224028/8224028.changeset
17-05-2019

Not yet. I am waiting for some one to help to push: https://mail.openjdk.java.net/pipermail/net-dev/2019-May/012585.html
17-05-2019

This trouble breaks the build on 4.8.5, raising priority. Is somebody pushing the fix for you?
17-05-2019

RFR: https://mail.openjdk.java.net/pipermail/serviceability-dev/2019-May/028095.html
16-05-2019