Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8083039 | emb-9 | Unassigned | P4 | Resolved | Fixed | b34 |
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;
}
/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;
}
- backported by
-
JDK-8083039 XCode 6.0 (Clang) warning "operator new' should not return a null pointer unless..."
-
- Resolved
-
- relates to
-
JDK-8060721 Test runtime/SharedArchiveFile/LimitSharedSizes.java fails in jdk 9 fcs new platforms/compiler
-
- Closed
-