Mon, 09 Jul 2018 05:53:08 -0700
8206454: [8u] os::current_stack_pointer() fails to compile on later Windows compilers (warning C4172: returning address of local variable)
Reviewed-by: dholmes, kbarrett
src/os_cpu/windows_x86/vm/os_windows_x86.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp Wed Jul 04 03:02:43 2018 -0400 1.2 +++ b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp Mon Jul 09 05:53:08 2018 -0700 1.3 @@ -454,11 +454,18 @@ 1.4 // Returns an estimate of the current stack pointer. Result must be guaranteed 1.5 // to point into the calling threads stack, and be no lower than the current 1.6 // stack pointer. 1.7 +#if defined(_MSC_VER) && _MSC_VER >= 1900 1.8 +// warning C4172: returning address of local variable or temporary: dummy 1.9 +#pragma warning(disable: 4172) 1.10 +#endif 1.11 address os::current_stack_pointer() { 1.12 int dummy; 1.13 address sp = (address)&dummy; 1.14 return sp; 1.15 } 1.16 +#if defined(_MSC_VER) && _MSC_VER >= 1900 1.17 +#pragma warning(default: 4172) 1.18 +#endif 1.19 #else 1.20 // Returns the current stack pointer. Accurate value needed for 1.21 // os::verify_stack_alignment().