blob: a1e7e59323bd23b559a85cd41bba9bdc3bdfcf3d [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From b431cb4e1ed060122fa300dc0008f74080d38f73 Mon Sep 17 00:00:00 2001
Patrick Williamsc0f7c042017-02-23 20:41:17 -06002From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 9 May 2016 22:03:57 +0000
4Subject: [PATCH] mdadm.h: Undefine dprintf before redefining
5
6dprintf is also defined in libc see
7usr/include/bits/stdio2.h, this comes into
8play especially when fortify sources is enabled
9and compilers like clang reports the override
10
11In file included from policy.c:25:
12./mdadm.h:1562:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined]
13 ^
14/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/bits/stdio2.h:145:12: note: previous definition is here
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060017Upstream-Status: Pending
Brad Bishop19323692019-04-05 15:28:33 -040018---
Patrick Williamsc0f7c042017-02-23 20:41:17 -060019 mdadm.h | 2 ++
20 1 file changed, 2 insertions(+)
21
22diff --git a/mdadm.h b/mdadm.h
Brad Bishop19323692019-04-05 15:28:33 -040023index 387e681..bb943bf 100644
Patrick Williamsc0f7c042017-02-23 20:41:17 -060024--- a/mdadm.h
25+++ b/mdadm.h
Brad Bishop19323692019-04-05 15:28:33 -040026@@ -1649,11 +1649,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container)
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027 }
28
29 #ifdef DEBUG
30+#undef dprintf
31 #define dprintf(fmt, arg...) \
32 fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg)
33 #define dprintf_cont(fmt, arg...) \
34 fprintf(stderr, fmt, ##arg)
35 #else
36+#undef dprintf
37 #define dprintf(fmt, arg...) \
38 ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; })
39 #define dprintf_cont(fmt, arg...) \