Relates :
|
New warning with official XCode 6.0 release, compiling fastdebug (and probably slowdebug as well): /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; ^ Proposed fix: static void * zero = (void *) 0; void* operator new(size_t size) /* throw(std::bad_alloc) */ { fatal("Should not call global operator new"); return zero; } void* operator new [](size_t size) /* throw(std::bad_alloc) */ { fatal("Should not call global operator new[]"); return zero; }