RFR: 8289049: x86_32 build fails with GCC 11 due to newString646_US warning [v3]
Thomas Stuefe
stuefe at openjdk.org
Wed Aug 17 08:59:15 UTC 2022
On Mon, 15 Aug 2022 13:56:38 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> See bug report for reproducer and error message. The warning looks quite superficial, and I initially suspected that it complains about `int len = (int)strlen(str)` cast of `size_t`. But what is confusing is nearly the similar code in `newStringCp1252` apparently does not produce the warning: https://github.com/openjdk/jdk/blob/f5d1b5bda27c798347ae278cbf69725ed4be895c/src/java.base/share/native/libjava/jni_util.c#L533-L566
>>
>> I propose we chalk it up to false/odd compiler warning and sync up unproblematic `newStringCp1252` and `newString646_US` implementation to dodge it.
>>
>> Additional testing:
>> - [x] Linux x86_32 build with GCC 11
>> - [x] Linux x86_32 `tier1` test with GCC 9
>> - [x] Linux x86_64 `tier1` test with GCC 9
>
> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - Also improve newSizedString8859_1
> - Merge branch 'master' into JDK-8289049-gcc11-x86-32
> - Init buf in newStringCp1252
> - Another fix
> - Fix
I'm confused. How does adding EnsureCapacity in newString646_US fix the compiler warning mentioned in JBS?
-------------
PR: https://git.openjdk.org/jdk/pull/9702
More information about the core-libs-dev
mailing list