-
Enhancement
-
Resolution: Unresolved
-
P4
-
9
It may be a good idea to fix all these implicit narrowing conversions and re-enable -Wconversion warning by default.
Unfortunately there's quite some code which has to be changed in order to meet the requirements of '-Wconversion'. A quick research showed that there are currently 137 different implicit narrowing conversions (see below) spread over 1785 different code locations:
warning: conversion to ‘CardIdx_t {aka int}’ from ‘uintptr_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘char’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘char’ from ‘short unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘CodeBuffer::csize_t {aka int}’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘CodeBuffer::csize_t {aka int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘CodeBuffer::csize_t {aka int}’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘CodeBuffer::csize_t {aka int}’ from ‘ptrdiff_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘CodeBuffer::csize_t {aka int}’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘CodeSection::csize_t {aka int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘jlong {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘julong {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘ssize_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘double’ from ‘uintx {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘Elf_Word {aka unsigned int}’ from ‘Elf64_Addr {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘Elf_Word {aka unsigned int}’ from ‘Elf64_Xword {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘double’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘float’ from ‘unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘InCSetState::in_cset_state_t {aka signed char}’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘int16_t {aka short int}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘int32_t {aka int}’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int32_t {aka int}’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int32_t {aka int}’ from ‘jlong {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int32_t {aka int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘int32_t {aka int}’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘int32_t {aka int}’ from ‘uintx {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘int8_t {aka signed char}’ from ‘int32_t {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘int8_t {aka signed char}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘int8_t {aka signed char}’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘intArray::etype {aka int}’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘intArray::etype {aka int}’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘Elf64_Xword {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘jlong {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘julong {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘__off_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘ssize_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘u8 {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘uintptr_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘int’ from ‘uintx {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘jboolean {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘jboolean {aka unsigned char}’ from ‘jint {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘jbyte {aka signed char}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘jbyte {aka signed char}’ from ‘jint {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘jchar {aka short unsigned int}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘jchar {aka short unsigned int}’ from ‘jint {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘jfloat {aka float}’ from ‘double’ may alter its value [-Wconversion]
warning: conversion to ‘jfloat {aka float}’ from ‘jdouble {aka double}’ may alter its value [-Wconversion]
warning: conversion to ‘jint {aka int}’ from ‘int64_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘jint {aka int}’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘jint {aka int}’ from ‘jlong {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘jint {aka int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘jint {aka int}’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘jint {aka int}’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘jint {aka int}’ from ‘u8 {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘jshort {aka short int}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘jshort {aka short int}’ from ‘jint {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘jubyte {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘juint {aka unsigned int}’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘juint {aka unsigned int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘juint {aka unsigned int}’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘jushort {aka short unsigned int}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘long unsigned int:40’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘narrowKlass {aka unsigned int}’ from ‘uint64_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘narrowOop {aka unsigned int}’ from ‘uint64_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘OptoReg::Name {aka int}’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘OptoReg::Name {aka int}’ from ‘uintptr_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘OSThread::thread_id_t {aka int}’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘s4 {aka int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘s_char {aka signed char}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘short int’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘short int’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘short int’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘short int’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘short int’ from ‘OptoReg::Name {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘short unsigned int:11’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘short unsigned int’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘short unsigned int’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘short unsigned int’ from ‘jint {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘short unsigned int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘short unsigned int’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘short unsigned int’ from ‘unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘size_t {aka long unsigned int}’ from ‘double’ may alter its value [-Wconversion]
warning: conversion to ‘u1 {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘u1 {aka unsigned char}’ from ‘u2 {aka short unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘u1 {aka unsigned char}’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘u2 {aka short unsigned int}’ from ‘int32_t {aka int}’ may alter its value [-Wconversion]
warning: conversion to ‘u2 {aka short unsigned int}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘u2 {aka short unsigned int}’ from ‘u4 {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘u2 {aka short unsigned int}’ from ‘uintptr_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘u2 {aka short unsigned int}’ from ‘unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘u4 {aka unsigned int}’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘uint16_t {aka short unsigned int}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘uint32_t {aka unsigned int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘address_word {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘int64_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘jlong {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘uintptr_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘uint {aka unsigned int}’ from ‘uintx {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char:1’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char:2’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char’ from ‘int’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char’ from ‘MEMFLAGS {aka MemoryType}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char’ from ‘u2 {aka short unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char’ from ‘u4 {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char’ from ‘uint {aka unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned char’ from ‘unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘intptr_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘intx {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘julong {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘long int’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘long unsigned int’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘__off_t {aka long int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘uintptr_t {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘unsigned int’ from ‘uintx {aka long unsigned int}’ may alter its value [-Wconversion]
warning: conversion to ‘u_short {aka short unsigned int}’ from ‘int’ may alter its value [-Wconversion]
warning: the result of the conversion is unspecified because ‘-0x00000000000000001’ is outside the range of type ‘Dependencies::DepType’ [-Wconversion]
- relates to
-
JDK-8233144 undefined behavior: signed integer overflow
- Open
-
JDK-8160310 HotSpot cannot be built with GCC 6
- Resolved
-
JDK-8135179 Fix conversion warning after 8067341
- Resolved
-
JDK-8313892 Fix -Wconversion warnings in java.desktop code
- Open
-
JDK-8281213 Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale
- Resolved
-
JDK-8281214 Unsafe use of long in VMThread::setup_periodic_safepoint_if_needed
- Resolved
-
JDK-8314258 checked_cast doesn't properly check some cases
- Open
-
JDK-8281455 Change JVM options with small ranges from 64 to 32 bits, for gc_globals.hpp
- Resolved
1.
|
Prepare GC code for -Wconversion | Open | Unassigned | ||
2.
|
Prepare Runtime code for -Wconversion | Closed | Coleen Phillimore | ||
3.
|
Prepare Compiler code for -Wconversion | Open | Unassigned | ||
4.
|
Prepare MnM code for -Wconversion | Open | Unassigned |