git: a64a3b798825 - main - libc/tests/stdlib/dynthr_mod/dynthr_mod.c: mark dummy as used
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 29 Nov 2021 15:43:17 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=a64a3b798825bc176ae052fc3ead88566b60ba7d
commit a64a3b798825bc176ae052fc3ead88566b60ba7d
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-28 03:25:28 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-11-29 15:39:51 +0000
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);
}