[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2] include/essentials: Fix redefinition warnings when using newlib


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 29 Mar 2019 20:05:40 +0200
  • Cc: simon.kuenzer@xxxxxxxxx
  • Delivery-date: Fri, 29 Mar 2019 18:05:53 +0000
  • Ironport-phdr: 9a23:thwjthcW2f3xBoQVSJ8NBtL4lGMj4u6mDksu8pMizoh2WeGdxcS7ZR7h7PlgxGXEQZ/co6odzbaP6+awBidfsN6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vMBm6twbcu8sZjYZgLqs61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoBOjUk8m/Yl9Zwgbpbrhy/uhJxzY3aboaOOfZiYq/QZ88WSHBdUspNUSFKH4Oyb5EID+oEJetVsY79p0ASrRu/AwmnGeXhyiJQhn/rwKY31PguEQbd3Aw8HtIOtm7YrNHoNKcKTOC417XHzS7ZY/NOxDfy85LEcgomofyVW797bMnfyVE3Gg/YgVictJbpMjCV2+gXrWSX8ehtWfihhmI/tg18rSWjyt0vh4TJnI4Z1F7J+CtjzIooKtC0Vkh2asO+HpRKrSGVLY52T9snQ2FvpSk11KULuYW+fCgW0JQnwAPfa+Cff4iI/B3jUOGRLC9mhHJgYr2/hhKy/VK8xe3nTMW0yEtKoTFfntnWsXABzx3T6s6ZRfth5kqtxDmC2x3J5uxHIU04j7TXJ4Ajz7IqmJcfqUHDETX3mEXygq+WbEIk+u2w5uv7ZbXmvYOcN45yig3kNqQuh9S/AfkjPwcSRGiX4/y81KD48kHjWrVKieU6krPFv5DCOcQbuqm5DhdQ0oYi7Ra/DjCm0M8BkXYaMl1FZgyIj4zyNlHKIfD4Fuu/g0+2nDZk2f/GOKftApLXLnjMiL3hZ6py61ZAyAovytBS/4lUCrAEIPL0XE/9rt/YDgInPAyywufoFs9925gYWW2RHqCZNLndvkSS6u0xPunfLLMS7TP8Lfki/LvigGE0nXcZfLK1xt0HZXb+Ge5pcGuDZn+5qdAaDWYM9i4jVPGi3FaFSiJSYTC2QrohzjogTpq7B8HZQdb+0/S6wC6nE8gONSh9AVeWHCKweg==
  • Ironport-sdr: 0XyFXU8qWYNabKnei1WaqRG6coKnMj5d3vqhs+UtWwKhMME2RZQI4v/fzqtpBGNQWzMVYyPtZy nDWth2fOn/Xw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

For some macrodefinitions, newlib headers do not care if they were
previously defined and this results in redefinitions compiler warnings.
In some way, it makes sense to give priority to newlib's definitions if
one decides to use it as a libc implementation. Therefore we include the
newlib headers in essentials.h to give priority to their definitions
instead of ours.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 include/uk/essentials.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/uk/essentials.h b/include/uk/essentials.h
index 47e04f7c..d9b24fcb 100644
--- a/include/uk/essentials.h
+++ b/include/uk/essentials.h
@@ -38,6 +38,20 @@
 #ifndef __UK_ESSENTIALS_H__
 #define __UK_ESSENTIALS_H__
 
+#include <uk/config.h>
+
+#if CONFIG_LIBNEWLIBC
+/*
+ * Needed for __used, __unused, __packed, __section,
+ *   __nonnull, __offsetof, __containerof
+ */
+#include <sys/cdefs.h>
+/* Needed for __STRINGIFY */
+#include <sys/param.h>
+/* Needed for MIN, MAX */
+#include <inttypes.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.