From b2fb626a3876cf6abe19848d83630aabfba23f95 Mon Sep 17 00:00:00 2001 From: Chris Meyering Date: Fri, 31 Jan 2020 22:05:13 -0800 Subject: build: tests/test-winmsgbuf.c: avoid GCC 10 alloca warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/tests/test-winmsgbuf.c (main): Replace alloca with malloc/free to prevent the following warning: tests/test-winmsgbuf.c:298:19:\ warning: implicit declaration of function ‘alloca’; did you mean \ ‘calloc’? --- src/tests/test-winmsgbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tests/test-winmsgbuf.c b/src/tests/test-winmsgbuf.c index 681d81c..acf8386 100644 --- a/src/tests/test-winmsgbuf.c +++ b/src/tests/test-winmsgbuf.c @@ -295,7 +295,7 @@ int main(void) * concatenation */ char *add = "bar"; size_t szadd = strlen(add); - char *expect2 = alloca(strlen(expect) + szadd + 1); + char *expect2 = malloc(strlen(expect) + szadd + 1); strcpy(expect2, expect); strcat(expect2, add); ASSERT(wmbc_printf(wmbc, "%s", add) == (int)szadd); @@ -322,6 +322,7 @@ int main(void) wmbc_free(wmbc); wmb_free(wmb); + free(expect2); } /* scenerio: merging the contents of two separate buffers, also -- cgit v1.2.1