JDK-8313889 : Fix -Wconversion warnings in foreign benchmarks
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.foreign
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-08-07
  • Updated: 2023-08-14
  • Resolved: 2023-08-08
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 22
22 b10Fixed
Related Reports
Relates :  
Description
There are a couple of -Wconversion warnings in the foreign benchmarks:

./test/micro/org/openjdk/bench/java/lang/foreign/libQSortJNI.c: In function ‘Java_org_openjdk_bench_java_lang_foreign_QSort_jni_1qsort_1optimized’:
./test/micro/org/openjdk/bench/java/lang/foreign/libQSortJNI.c:59:17: warning: conversion to ‘size_t’ {aka ‘long unsigned int’} from ‘jsize’ {aka ‘int’} may change the sign of the result [-Wsign-conversion]
   59 |     qsort(ints, length, sizeof(jint), &comparator);
      |                 ^~~~~~
./test/micro/org/openjdk/bench/java/lang/foreign/libQSortJNI.c: In function ‘Java_org_openjdk_bench_java_lang_foreign_QSort_jni_1qsort_1naive’:
./test/micro/org/openjdk/bench/java/lang/foreign/libQSortJNI.c:87:17: warning: conversion to ‘size_t’ {aka ‘long unsigned int’} from ‘jsize’ {aka ‘int’} may change the sign of the result [-Wsign-conversion]
   87 |     qsort(carr, length, sizeof(jint), java_cmp);
      |

Comments
Changeset: 509f80bb Author: Jorn Vernee <jvernee@openjdk.org> Date: 2023-08-08 13:59:35 +0000 URL: https://git.openjdk.org/jdk/commit/509f80bb047beb49fb8ecb62bffb0d0fd4fe75cb
08-08-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15179 Date: 2023-08-07 14:40:42 +0000
07-08-2023