RFR(T): 8249875: GCC 10 warnings -Wtype-limits with JFR code

Markus Gronlund markus.gronlund at oracle.com
Wed Jul 22 18:59:56 UTC 2020


Looks good.

Thanks
Markus

-----Original Message-----
From: Yasumasa Suenaga <suenaga at oss.nttdata.com> 
Sent: den 22 juli 2020 16:46
To: hotspot-jfr-dev at openjdk.java.net
Subject: RFR(T): 8249875: GCC 10 warnings -Wtype-limits with JFR code

Hi all,

Please review this issue:

   JBS: https://bugs.openjdk.java.net/browse/JDK-8249875
   webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8249875/webrev.00/

I saw some warnings in JFR code when I tried to build OpenJDK with GCC 10.1.1 on Fedora 32:

```
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/jfr/utilities/jfrHashtable.hpp:86:14: warning: comparison of unsigned expression in '>= 0' is always true [-Wtype-limits]
    86 | assert(h >= 0 && h < _table_size, "Illegal hash value");
       | ~~^~~~
```

```
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp:138:17: warning: comparison of unsigned expression in '>= 0' is always true [-Wtype-limits]
   138 | assert(_count >= 0, "invariant"); ```

Both `h` and `_cound` are unsigned type, so we can remove them.
I think this is trivial change.


Thanks,

Yasumasa


More information about the hotspot-jfr-dev mailing list