changeset 8875:e25662a88116

8206454: [8u] os::current_stack_pointer() fails to compile on later Windows compilers (warning C4172: returning address of local variable) Reviewed-by: dholmes, kbarrett
author kevinw
date Mon, 09 Jul 2018 05:53:08 -0700
parents ad057f2e3211
children aeacee5afc4d
files src/os_cpu/windows_x86/vm/os_windows_x86.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Wed Jul 04 03:02:43 2018 -0400
+++ b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Mon Jul 09 05:53:08 2018 -0700
@@ -454,11 +454,18 @@
 // Returns an estimate of the current stack pointer. Result must be guaranteed
 // to point into the calling threads stack, and be no lower than the current
 // stack pointer.
+#if defined(_MSC_VER) && _MSC_VER >= 1900
+// warning C4172: returning address of local variable or temporary: dummy
+#pragma warning(disable: 4172)
+#endif
 address os::current_stack_pointer() {
   int dummy;
   address sp = (address)&dummy;
   return sp;
 }
+#if defined(_MSC_VER) && _MSC_VER >= 1900
+#pragma warning(default: 4172)
+#endif
 #else
 // Returns the current stack pointer. Accurate value needed for
 // os::verify_stack_alignment().