101-mdadm.h-Undefine-dprintf-before-redefining.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 6d369e8f226594632ce4260129509daf7030de0a Mon Sep 17 00:00:00 2001
  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. dprintf is also defined in libc see
  6. usr/include/bits/stdio2.h, this comes into
  7. play especially when fortify sources is enabled
  8. and compilers like clang reports the override
  9. In file included from policy.c:25:
  10. ./mdadm.h:1562:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined]
  11. ^
  12. /mnt/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/bits/stdio2.h:145:12: note: previous definition is here
  13. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  14. ---
  15. Upstream-Status: Pending
  16. mdadm.h | 2 ++
  17. 1 file changed, 2 insertions(+)
  18. --- a/mdadm.h
  19. +++ b/mdadm.h
  20. @@ -1595,11 +1595,13 @@ static inline char *to_subarray(struct m
  21. }
  22. #ifdef DEBUG
  23. +#undef dprintf
  24. #define dprintf(fmt, arg...) \
  25. fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg)
  26. #define dprintf_cont(fmt, arg...) \
  27. fprintf(stderr, fmt, ##arg)
  28. #else
  29. +#undef dprintf
  30. #define dprintf(fmt, arg...) \
  31. ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; })
  32. #define dprintf_cont(fmt, arg...) \