Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | From b431cb4e1ed060122fa300dc0008f74080d38f73 Mon Sep 17 00:00:00 2001 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 9 May 2016 22:03:57 +0000 |
| 4 | Subject: [PATCH] mdadm.h: Undefine dprintf before redefining |
| 5 | |
| 6 | dprintf is also defined in libc see |
| 7 | usr/include/bits/stdio2.h, this comes into |
| 8 | play especially when fortify sources is enabled |
| 9 | and compilers like clang reports the override |
| 10 | |
| 11 | In 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 | |
| 16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 17 | Upstream-Status: Pending |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | --- |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 19 | mdadm.h | 2 ++ |
| 20 | 1 file changed, 2 insertions(+) |
| 21 | |
| 22 | diff --git a/mdadm.h b/mdadm.h |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 23 | index 387e681..bb943bf 100644 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 24 | --- a/mdadm.h |
| 25 | +++ b/mdadm.h |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 26 | @@ -1649,11 +1649,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 27 | } |
| 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...) \ |