RFR: 8036675 Compiler warnings in serviceability code
Alan Bateman
Alan.Bateman at oracle.com
Wed Mar 5 13:06:05 UTC 2014
On 05/03/2014 12:14, Staffan Larsen wrote:
> This change addresses two compiler warnings in serviceability code.
>
>
> /home/staffan/mercurial/jdk9-dev/jdk/src/share/native/sun/tracing/dtrace/JVM.c:292:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> if (len>= sizeof(buf)) {
>
> In this case I added a cast from size_t to jsize.
>
>
> /home/staffan/mercurial/jdk9-dev/jdk/src/share/demo/jvmti/hprof/hprof_init.c:244:5: warning: comparison is always false due to limited range of data type [-Wtype-limits]
> if (port == 0 || port> 65535) {
>
> In this case I keep the port number as an int until after the validation is done.
>
This looks okay to me and keeping the port as an int seems okay too.
-Alan
More information about the serviceability-dev
mailing list