JDK-8253154 : Windows (MSVC 2017) build fails after JDK-8247910
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-09-15
  • Updated: 2020-09-16
  • Resolved: 2020-09-16
Related Reports
Duplicate :  
Relates :  
Description
This seems to start happening after JDK-8247910:

c:/buildbot/worker/build-jdkX-windows/build/test/hotspot/gtest/utilities/test_align.cpp(96): error C2220: warning treated as error - no 'object' file generated
c:/buildbot/worker/build-jdkX-windows/build/test/hotspot/gtest/utilities/test_align.cpp(156): note: see reference to function template instantiation 'void static_test_alignments<T,A>(void)' being compiled
        with
        [
            T=int64_t,
            A=uint8_t
        ]
c:/buildbot/worker/build-jdkX-windows/build/test/hotspot/gtest/utilities/test_align.cpp(162): note: see reference to function template instantiation 'void test_alignments<int64_t,uint8_t>(void)' being compiled
c:/buildbot/worker/build-jdkX-windows/build/test/hotspot/gtest/utilities/test_align.cpp(96): warning C4307: '+': integral constant overflow
Comments
I had created this one : https://bugs.openjdk.java.net/browse/JDK-8253154
16-09-2020

I think this is another case of this bug: https://developercommunity.visualstudio.com/content/problem/211134/unsigned-integer-overflows-in-constexpr-functionsa.html This problem has already come up elsewhere with 8253089: Windows (MSVC 2017) build fails after JDK-8243208 I think we'll keep hitting this in various forms as we add uses of constexpr. So I think the only plausible solution is to disable that warning for VS versions prior to the one that fixes that bug (mentioned in the referenced bug report).
16-09-2020

I have upgraded my CI nodes to MSVC 2019 to dodge this, so this issue is up for grabs.
15-09-2020

I believe it is MSVC 2017 -only issue again. MSVC 2019 seems to build this fine.
15-09-2020