From a64a3b798825bc176ae052fc3ead88566b60ba7d Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 28 Nov 2021 05:25:28 +0200 Subject: [PATCH] libc/tests/stdlib/dynthr_mod/dynthr_mod.c: mark dummy as used It receives the malloc() result, and we do not want the malloc() call to be optimized out, which is allowed for hosted compiler. Use dummy for actual write though. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c b/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c index 4f5622f47a81..c19a1a54a8b6 100644 --- a/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c +++ b/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c @@ -51,6 +51,7 @@ mod_thread(void *ptr __unused) char *volatile dummy; dummy = malloc(500); + *dummy = 'a'; return (NULL); }