Skip to content

Commit 34a5b87

Browse files
committed
8306579: Consider building with /Zc:throwingNew
Reviewed-by: rschmelter Backport-of: a289bcfe7e2786d05c338712b818fc4ef12cb4ac
1 parent 32bb1bf commit 34a5b87

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
625625
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced -fno-exceptions \
626626
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
627627
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
628-
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -permissive- -MP"
629-
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -permissive- -Zc:wchar_t-"
628+
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:throwingNew -permissive- -MP"
629+
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:throwingNew -permissive- -Zc:wchar_t-"
630630
fi
631631
632632
# CFLAGS C language level for JDK sources (hotspot only uses C++)

src/java.desktop/windows/native/libawt/windows/awt_new.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,6 @@ void *safe_Realloc(void *memblock, size_t size) throw (std::bad_alloc) {
114114
return ret_val;
115115
}
116116

117-
#if !defined(DEBUG)
118-
// This function exists because VC++ 5.0 currently does not conform to the
119-
// Standard C++ specification which requires that operator new throw
120-
// std::bad_alloc in an out of memory situation. Instead, VC++ 5.0 returns 0.
121-
//
122-
// This function can be safely removed when the problem is corrected.
123-
void * CDECL operator new(size_t size) throw (std::bad_alloc) {
124-
return safe_Malloc(size);
125-
}
126-
#endif
127-
128117
// This function is called at the beginning of an entry point.
129118
// Entry points are functions which are declared:
130119
// 1. CALLBACK,

0 commit comments

Comments
 (0)