From: Wei Liu <wei.liu2@citrix.com>
To: Minios-devel <minios-devel@lists.xenproject.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
Wei Liu <wei.liu2@citrix.com>,
Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [MINIOS PATCH] lib.h: remove BUILD_BUG_ON
Date: Fri, 12 Aug 2016 15:01:07 +0100 [thread overview]
Message-ID: <1471010467-32751-1-git-send-email-wei.liu2@citrix.com> (raw)
BUILD_BUG_ON should not appear in a public-facing header, otherwise it
risks clashing with macro with the same name in other code bases. I
encountered such issue when trying to add BUILD_BUG_ON to a private
header in Xen's gnttab library.
Ideally BUILD_BUG_ON should be moved to a private header, but there is
actually no user of it in mini-os tree, just remove it.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
include/lib.h | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/include/lib.h b/include/lib.h
index 39d6a18..e7155e2 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -54,15 +54,6 @@
#include <xen/event_channel.h>
#include "gntmap.h"
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
-#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); })
-#define BUILD_BUG_ON_ZERO(cond) \
- sizeof(struct { _Static_assert(!(cond), "!(" #cond ")"); })
-#else
-#define BUILD_BUG_ON_ZERO(cond) sizeof(struct { int:-!!(cond); })
-#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
-#endif
-
#ifdef HAVE_LIBC
#include <sys/queue.h>
#include <stdio.h>
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next reply other threads:[~2016-08-12 14:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 14:01 Wei Liu [this message]
2016-08-12 14:02 ` [MINIOS PATCH] lib.h: remove BUILD_BUG_ON Samuel Thibault
2016-08-12 15:14 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471010467-32751-1-git-send-email-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=minios-devel@lists.xenproject.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).