From 47f9cf0422907b54a1897ca54b3c9623d8e49eca Mon Sep 17 00:00:00 2001 From: christos Date: Mon, 6 Mar 2017 21:02:47 +0000 Subject: [PATCH] add builtin_offsetof --- tests/usr.bin/xlint/lint1/Makefile | 3 ++- tests/usr.bin/xlint/lint1/d_cast_typeof.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/usr.bin/xlint/lint1/Makefile b/tests/usr.bin/xlint/lint1/Makefile index 8bf298aaa001..a1e51819775b 100644 --- a/tests/usr.bin/xlint/lint1/Makefile +++ b/tests/usr.bin/xlint/lint1/Makefile @@ -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 @@ TESTS_SH= t_integration 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 --git a/tests/usr.bin/xlint/lint1/d_cast_typeof.c b/tests/usr.bin/xlint/lint1/d_cast_typeof.c index 32b1e6bf4bbd..3ca62eac4e26 100644 --- a/tests/usr.bin/xlint/lint1/d_cast_typeof.c +++ b/tests/usr.bin/xlint/lint1/d_cast_typeof.c @@ -7,6 +7,8 @@ struct foo *hole; char * foo(void) { - return ((char *)&((typeof(hole))0)->list); + return hole ? + ((char *)&((typeof(hole))0)->list) : + ((char *)&((typeof(*hole) *)0)->list); }