RFR(T): 8249875: GCC 10 warnings -Wtype-limits with JFR code
Yasumasa Suenaga
suenaga at oss.nttdata.com
Wed Jul 22 14:46:16 UTC 2020
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