From: Benjamin Peterson Date: Fri, 31 Mar 2017 11:05:25 +0000 (-0700) Subject: suppress compiler warnings in _ctypes_test (#902) X-Git-Tag: v3.7.0a1~1029 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=164d30eb1e66575dafee6af4fca4cbf52c7fbe6a;p=thirdparty%2FPython%2Fcpython.git suppress compiler warnings in _ctypes_test (#902) Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler. --- diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c index 9410c7fba84a..fe0015c80136 100644 --- a/Modules/_ctypes/_ctypes_test.c +++ b/Modules/_ctypes/_ctypes_test.c @@ -52,9 +52,9 @@ _testfunc_cbk_large_struct(Test in, void (*func)(Test)) EXPORT(void) _testfunc_large_struct_update_value(Test in) { - in.first = 0x0badf00d; - in.second = 0x0badf00d; - in.third = 0x0badf00d; + ((volatile Test *)&in)->first = 0x0badf00d; + ((volatile Test *)&in)->second = 0x0badf00d; + ((volatile Test *)&in)->third = 0x0badf00d; } EXPORT(void)testfunc_array(int values[4])