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 gcc seems to pad small character arrays, ...
details: https://anonhg.NetBSD.org/src/rev/78971472e7ff
branches: trunk
changeset: 766084:78971472e7ff
user: plunky <plunky%NetBSD.org@localhost>
date: Wed Jun 15 06:09:21 2011 +0000
description:
gcc seems to pad small character arrays, use an array of ints
while here, make the poke function non-static, so that it doesnt
get optimised away
diffstat:
tests/lib/libc/ssp/h_raw.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diffs (37 lines):
diff -r ad6c858e3395 -r 78971472e7ff tests/lib/libc/ssp/h_raw.c
--- a/tests/lib/libc/ssp/h_raw.c Wed Jun 15 05:50:48 2011 +0000
+++ b/tests/lib/libc/ssp/h_raw.c Wed Jun 15 06:09:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_raw.c,v 1.3 2011/06/12 21:12:46 plunky Exp $ */
+/* $NetBSD: h_raw.c,v 1.4 2011/06/15 06:09:21 plunky Exp $ */
/*
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,20 +29,22 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2011\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: h_raw.c,v 1.3 2011/06/12 21:12:46 plunky Exp $");
+__RCSID("$NetBSD: h_raw.c,v 1.4 2011/06/15 06:09:21 plunky Exp $");
#include <stdlib.h>
-static void
-poke(char *b, size_t index)
+void poke(int *, size_t);
+
+void
+poke(int *b, size_t index)
{
- b[index] = 'A';
+ b[index] = 42;
}
int
main(int argc, char *argv[])
{
- char b[10];
+ int b[10];
poke(b, atoi(argv[1]));
return 0;
Home |
Main Index |
Thread Index |
Old Index