summaryrefslogtreecommitdiff
path: root/devel/sparse/patches/patch-dissect.h
blob: b0b537b7ad5a8654aca6c9ed2652d1ce74fedc4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$NetBSD: patch-dissect.h,v 1.1 2013/03/31 00:04:50 dholland Exp $

Replace questionable construction that clang objects to with a
slightly less questionable version that is hopefully equivalent.

--- dissect.h~	2007-05-01 18:30:58.000000000 +0000
+++ dissect.h
@@ -27,13 +27,16 @@ struct reporter
 extern void dissect(struct symbol_list *, struct reporter *);
 
 #define	MK_IDENT(s)	({				\
-	static struct {					\
+	static union {					\
 		struct ident ident;			\
-		char __[sizeof(s)];			\
-	} ident = {{					\
-		.len  = sizeof(s)-1,			\
-		.name = s,				\
-	}};						\
+		struct {				\
+			char id[sizeof(struct ident)];	\
+			char name[sizeof(s)];		\
+		} named;				\
+	} ident = {					\
+		.ident.len  = sizeof(s)-1,		\
+		.named.name = s,			\
+	};						\
 	&ident.ident;					\
 })