RFR: 8263028: Windows build fails due to several treat-warning-as-errors
Jorn Vernee
jvernee at openjdk.java.net
Tue Mar 23 13:50:42 UTC 2021
On Tue, 23 Mar 2021 13:04:26 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> I have confirmed that this problem is related to a specific msvc version(At least it happens in msvc 19.28.29334, I have not tested other msvc versions). After applying this patch, I can build successfully, both on upstream JDK and Alibaba JDK.
>>
>> I have written a minimal reproducible demo. When the /WX(Treats all compiler warnings as errors) option is turned on, the compiler issued the same warnings. After disabling these warnings via `#pragma`, the compiler will not complain about anything, the execution result is exactly as I expected. Besides, all test cases under `compiler/compilercontrol/` are passed except ClearDirectivesFileStackTest.java which has been problem-listed before. So I believe this is a false positive of the compilation warning, turning it off or on will not affect the runtime behavior.
>>
>> FYI: See detailed jtreg log and minimal reproducible demo on JBS attachments.
>>
>> Thanks,
>> Yang
>
> I happened to have the exact same version of cl.exe (19.28.29334) but have not been seeing this issue, and I can't reproduce it with the reproducer you attached to the JBS issue either.
>
> I do note that the reproducer has a bunch of `LS` characters where `LF` are expected, and Visual Studio asks if I want to normalize them, but, whether I do that or not doesn't change the outcome. I just don't get the same warnings.
>
> So, it seems like there might be an environment/configuration problem somewhere, and these warnings are just a symptom of that. It might be worth it to investigate further.
Based on Ioi's suggestion I decided to try with a different locale as well. I tried setting my system locale to `Chinese (Simplified, China)` and with that I was able to reproduce the warnings you report, so it indeed seems to be an issue with locale settings. AFAIK only `en-us` is supported.
I've had problems in the past as well because I had the wrong locale set, and some of the tests were failing because of that. So, maybe rather than disabling the warnings, it might be more prudent to change the system locale of the used build systems to prevent similar issues in the future (FWIW, the display language doesn't seem to affect `cl` so that could still be whatever is convenient).
-------------
PR: https://git.openjdk.java.net/jdk/pull/3107
More information about the hotspot-runtime-dev
mailing list