From: Jason A. Donenfeld Date: Fri, 27 Nov 2020 19:45:15 +0000 (+0100) Subject: runtime: return 0 from C function in test X-Git-Tag: go1.16beta1~154 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=91f77ca2f8;p=gostls13.git 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 --- 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"