Module Name:    src
Committed By:   christos
Date:           Mon Mar  6 21:02:47 UTC 2017

Modified Files:
        src/tests/usr.bin/xlint/lint1: Makefile d_cast_typeof.c

Log Message:
add builtin_offsetof


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/d_cast_typeof.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.14 src/tests/usr.bin/xlint/lint1/Makefile:1.15
--- src/tests/usr.bin/xlint/lint1/Makefile:1.14	Mon Mar  6 07:00:27 2017
+++ src/tests/usr.bin/xlint/lint1/Makefile	Mon Mar  6 16:02:47 2017
@@ -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

Index: src/tests/usr.bin/xlint/lint1/d_cast_typeof.c
diff -u src/tests/usr.bin/xlint/lint1/d_cast_typeof.c:1.1 src/tests/usr.bin/xlint/lint1/d_cast_typeof.c:1.2
--- src/tests/usr.bin/xlint/lint1/d_cast_typeof.c:1.1	Mon Mar  6 07:00:27 2017
+++ src/tests/usr.bin/xlint/lint1/d_cast_typeof.c	Mon Mar  6 16:02:47 2017
@@ -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);
 }
 

Reply via email to