JDK-8074795 : Fix for JDK-8030115 breaks Windows build in 8u
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 8u60
  • Priority: P1
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2015-03-10
  • Updated: 2015-03-10
  • Resolved: 2015-03-10
Related Reports
Duplicate :  
Description
The fix for 8030115 breaks the build on windows:


c:/jprt/T/P1/021115.drlong/s/jdk/src/share/native/sun/tracing/dtrace/JVM.c(200) : error C2143: syntax error : missing ';' before 'type'
c:/jprt/T/P1/021115.drlong/s/jdk/src/share/native/sun/tracing/dtrace/JVM.c(201) : error C2065: 'count' : undeclared identifier
c:/jprt/T/P1/021115.drlong/s/jdk/src/share/native/sun/tracing/dtrace/JVM.c(201) : error C2065: 'count' : undeclared identifier
c:/jprt/T/P1/021115.drlong/s/jdk/src/share/native/sun/tracing/dtrace/JVM.c(202) : error C2065: 'count' : undeclared identifier
c:/jprt/T/P1/021115.drlong/s/jdk/src/share/native/sun/tracing/dtrace/JVM.c(204) : error C2065: 'count' : undeclared identifier
c:/jprt/T/P1/021115.drlong/s/jdk/src/share/native/sun/tracing/dtrace/JVM.c(212) : error C2065: 'count' : undeclared identifier
make[2]: *** [/cygdrive/c/jprt/T/P1/021115.drlong/s/build/windows-x86_64-normal-server-fastdebug/jdk/objs/libjsdt/JVM.obj] Error 2 

The older MSC compiler doesn't support declarations in the middle of blocks IIRC so barfs on this:

@@ -195,16 +197,24 @@
     jvm_providers = (JVM_DTraceProvider*)calloc(
         num_providers, sizeof(*jvm_providers));

-    for (i = 0; i < num_providers; ++i) {
-        JVM_DTraceProvider* p = &(jvm_providers[i]);
+    int count = 0;
+    for (; count < num_providers; ++count) {