RFR(S): 8058827: XCode 6.0 (Clang) warning "operator new' should not return a null pointer unless..."

Gerard Ziemski gerard.ziemski at oracle.com
Mon Sep 22 14:49:31 UTC 2014


Thank you very much for fixing this.


cheers

On 9/19/2014 2:30 PM, David Chase wrote:
> bug: https://bugs.openjdk.java.net/browse/JDK-8058827
> webrev: http://cr.openjdk.java.net/~drchase/8058827/webrev.00/
>
> Problem: I decided I would find trouble before it found me, and installed XCode 6 and tried a fastdebug build.
> There appears to be one stopper, which is this warning compiling hotspot:
>
> /Users/dr2chase/work/jdk9/hotspot/src/share/vm/memory/allocation.cpp:698:3: error: 'operator new' should not return a null pointer unless it is declared 'throw()' [-Werror,-Wnew-returns-null]
>    return 0;
>    ^
>
> The file in question has a comment warning against careless meddling, so I did not touch the signature,
> and instead rewrote the zero as a static.
>
> Testing:
> compilation on Mavericks + XCode 6.0.1, compilation on Ubuntu 13.10 + Gcc 4.8, both fastdebug.
>
> I ran jtreg on hotspot/test/compiler and it looked basically functional (i.e., about as many failures as usual, about a dozen).
>
> David
>
>
>



More information about the hotspot-runtime-dev mailing list