aboutsummaryrefslogtreecommitdiffhomepage
path: root/test.c
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2023-06-04 10:16:46 +0200
committer lemon<lsof@mailbox.org>2023-06-04 10:20:27 +0200
commitbd390afdf4eabfe13c1dd18bde23f4246ad73514 (patch)
tree87aae438e37370773d345d6f18598681740cae21 /test.c
parent9c6a0b4340fe430e941586134f585c27309a0084 (diff)
optimize away unused results when expression is only evaluated for side effects
Diffstat (limited to 'test.c')
-rw-r--r--test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/test.c b/test.c
index e061b2b..b89942a 100644
--- a/test.c
+++ b/test.c
@@ -56,11 +56,9 @@ struct f2 f2test(struct f2 *r) {
return *r;
}
-void memset(char *p, int c, unsigned long n)
+void memset(volatile char *p, int c, unsigned long n)
{
- if (n) do {
- *p++ = c;
- } while (--n);
+ if (n) do *p++ = c; while (--n);
}