Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/ssp PR/51893: Ngie Cooper: prevent toolchain ...
details: https://anonhg.NetBSD.org/src/rev/89e50d7ee585
branches: trunk
changeset: 350700:89e50d7ee585
user: christos <christos%NetBSD.org@localhost>
date: Mon Jan 16 16:34:24 2017 +0000
description:
PR/51893: Ngie Cooper: prevent toolchain from optimizing out memset call
diffstat:
tests/lib/libc/ssp/h_memset.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (25 lines):
diff -r fbfa22dd6c52 -r 89e50d7ee585 tests/lib/libc/ssp/h_memset.c
--- a/tests/lib/libc/ssp/h_memset.c Mon Jan 16 16:32:13 2017 +0000
+++ b/tests/lib/libc/ssp/h_memset.c Mon Jan 16 16:34:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+/* $NetBSD: h_memset.c,v 1.2 2017/01/16 16:34:24 christos Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+__RCSID("$NetBSD: h_memset.c,v 1.2 2017/01/16 16:34:24 christos Exp $");
#include <stdio.h>
#include <string.h>
@@ -41,5 +41,5 @@
char b[10];
size_t len = atoi(argv[1]);
(void)memset(b, 0, len);
- return 0;
+ return b[0]; /* keeps optimizer from zapping the call to memset() */
}
Home |
Main Index |
Thread Index |
Old Index