RFR 8014431 : cleanup warnings indicated by the -Wunused-value compiler option on linux
David Holmes
david.holmes at oracle.com
Thu May 23 05:45:13 PDT 2013
Hi Calvin,
Mostly looks okay to me. A few comments
src/share/vm/memory/universe.cpp
Seems like a real bug!
--
src/share/vm/opto/memnode.cpp:
I think it is cleaner to add the (void) to the macro definition as in
other cases:
#define verify_memory_slice(m,i,n) (void)(0) // PRODUCT version is no-op
---
src/share/vm/runtime/perfData.hpp
This can't be right:
773 return create_string_variable(ns, name, (int)0, s, CHECK_NULL);
why do we have to cast 0 to int ????
---
src/share/vm/services/diagnosticArgument.cpp
Another real bug!
---
src/share/vm/utilities/taskqueue.hpp
I do not understand this code:
! // g++ complains if the volatile result of the assignment is unused.
! const_cast<E&>(_elems[localBot] = t);
why do we even need the const cast? How is the assignment not used ???
I understand your fix of adding (void) but I'm baffled by the original code.
---
Thanks,
David
-----
On 22/05/2013 5:32 AM, Calvin Cheung wrote:
> This change is for fixing the errors resulting from enabling the
> -Wunused-value compiler option on linux.
>
> The patch was initiated by Jeremy (jeremymanson at google.com).
> More changes are needed for it to pass the build.
>
> Tests performed:
> jprt
> jtreg on linux_x64
> vm.quick on linux_x64
>
> Webrev: http://cr.openjdk.java.net/~ccheung/8014431/webrev/
> Bug: http://bugs.sun.com/view_bug.do?bug_id=8014431
>
> thanks,
> Calvin
More information about the hotspot-runtime-dev
mailing list