Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/xlint/lint1 add builtin_offsetof



details:   https://anonhg.NetBSD.org/src/rev/2babe60374fb
branches:  trunk
changeset: 351948:2babe60374fb
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 06 21:02:47 2017 +0000

description:
add builtin_offsetof

diffstat:

 tests/usr.bin/xlint/lint1/Makefile        |  3 ++-
 tests/usr.bin/xlint/lint1/d_cast_typeof.c |  4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 41bf44363707 -r 2babe60374fb tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Mon Mar 06 21:01:39 2017 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Mon Mar 06 21:02:47 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2017/03/06 12:00:27 christos Exp $
+# $NetBSD: Makefile,v 1.15 2017/03/06 21:02:47 christos Exp $
 
 NOMAN=         # defined
 
@@ -10,6 +10,7 @@
 
 FILESDIR=      ${TESTSDIR}
 FILES+=                d_alignof.c
+FILES+=                d_bltinoffsetof.c
 FILES+=                d_c99_anon_struct.c
 FILES+=                d_c99_anon_union.c
 FILES+=                d_c99_complex_num.c
diff -r 41bf44363707 -r 2babe60374fb tests/usr.bin/xlint/lint1/d_cast_typeof.c
--- a/tests/usr.bin/xlint/lint1/d_cast_typeof.c Mon Mar 06 21:01:39 2017 +0000
+++ b/tests/usr.bin/xlint/lint1/d_cast_typeof.c Mon Mar 06 21:02:47 2017 +0000
@@ -7,6 +7,8 @@
 char *
 foo(void)
 {
-       return ((char *)&((typeof(hole))0)->list);
+       return hole ?
+           ((char *)&((typeof(hole))0)->list) :
+           ((char *)&((typeof(*hole) *)0)->list);
 }
 



Home | Main Index | Thread Index | Old Index