Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8313889

Fix -Wconversion warnings in foreign benchmarks

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • None
    • core-libs

      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);
            |

            jvernee Jorn Vernee
            jvernee Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: