From 91f77ca2f8590ed2051ee9a62d52676cf1bff98d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 27 Nov 2020 20:45:15 +0100 Subject: [PATCH] runtime: return 0 from C function in test This function's prototype includes a return value, so return a value. Otherwise clang gets upset: --- FAIL: TestDLLPreloadMitigation (1.40s) syscall_windows_test.go:986: failed to build dll: exit status 1 - nojack.c:7:1: error: non-void function does not return a value [-Werror,-Wreturn-type] } ^ 1 error generated. Fixes #42860. Change-Id: I65b8eb9ccb502692c5b65bd34829f331cd86eef0 Reviewed-on: https://go-review.googlesource.com/c/go/+/273726 Trust: Jason A. Donenfeld Trust: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick --- src/runtime/syscall_windows_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go index 3827c6ed83..a20573eb6a 100644 --- a/src/runtime/syscall_windows_test.go +++ b/src/runtime/syscall_windows_test.go @@ -969,8 +969,9 @@ func TestDLLPreloadMitigation(t *testing.T) { #include #include -uintptr_t cfunc() { +uintptr_t cfunc(void) { SetLastError(123); + return 0; } ` srcname := "nojack.c" -- 2.48.1