Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Nov 2021 15:43:17 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a64a3b798825 - main - libc/tests/stdlib/dynthr_mod/dynthr_mod.c: mark dummy as used
Message-ID:  <202111291543.1ATFhH5N066023@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111291543.1ATFhH5N066023>