Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/sys/kern/getcwd provide the out of address space tes...



details:   https://anonhg.NetBSD.org/src/rev/67b49eea48bf
branches:  trunk
changeset: 768517:67b49eea48bf
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 18 02:32:32 2011 +0000

description:
provide the out of address space test in a gcc-4.5 friendly way.

diffstat:

 regress/sys/kern/getcwd/Makefile |  7 +------
 regress/sys/kern/getcwd/getcwd.c |  4 ++--
 2 files changed, 3 insertions(+), 8 deletions(-)

diffs (36 lines):

diff -r 947de98dd51c -r 67b49eea48bf regress/sys/kern/getcwd/Makefile
--- a/regress/sys/kern/getcwd/Makefile  Thu Aug 18 02:26:38 2011 +0000
+++ b/regress/sys/kern/getcwd/Makefile  Thu Aug 18 02:32:32 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.6 2011/06/22 02:49:43 mrg Exp $
+#      $NetBSD: Makefile,v 1.7 2011/08/18 02:32:32 christos Exp $
 
 NOMAN=         # defined
 LDSTATIC=      -static
@@ -15,8 +15,3 @@
        @find /usr -type d -print | ./getcwd -s
 
 .include <bsd.prog.mk>
-
-# getcwd.c has an on-purpuse array bounds violation
-.if ${HAVE_GCC} == 45
-COPTS.getcwd.c+= -Wno-error
-.endif
diff -r 947de98dd51c -r 67b49eea48bf regress/sys/kern/getcwd/getcwd.c
--- a/regress/sys/kern/getcwd/getcwd.c  Thu Aug 18 02:26:38 2011 +0000
+++ b/regress/sys/kern/getcwd/getcwd.c  Thu Aug 18 02:32:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getcwd.c,v 1.9 2008/04/28 20:23:06 martin Exp $        */
+/*     $NetBSD: getcwd.c,v 1.10 2011/08/18 02:32:32 christos Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -343,7 +343,7 @@
        CHECK("/", __getcwd(kbuf, 0xdeadbeef), -1, ERANGE); /* large negative */
        CHECK("/", __getcwd(kbuf, 0x7000beef), 2, 0); /* large positive, rounds down */
        CHECK("/", __getcwd(kbuf, 0x10000), 2, 0); /* slightly less large positive, rounds down */
-       CHECK("/", __getcwd(kbuf+0x100000, sizeof(kbuf)), -1, EFAULT); /* outside address space */      
+       CHECK("/", __getcwd((void *)0x10000, sizeof(kbuf)), -1, EFAULT); /* outside address space */    
        CHECK("/", __getcwd(0, 30), -1, EFAULT);
        CHECK("/", __getcwd((void*)0xdeadbeef, 30), -1, EFAULT);
        CHECK("/", __getcwd(kbuf, 2), 2, 0);



Home | Main Index | Thread Index | Old Index