From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Minios-devel <minios-devel@lists.xenproject.org>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [MINIOS PATCH] lib.h: remove BUILD_BUG_ON
Date: Fri, 12 Aug 2016 16:02:11 +0200 [thread overview]
Message-ID: <20160812140211.GG3885@var.home> (raw)
In-Reply-To: <1471010467-32751-1-git-send-email-wei.liu2@citrix.com>
Wei Liu, on Fri 12 Aug 2016 15:01:07 +0100, wrote:
> 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>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
> 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
>
--
Samuel
(03:13:14) <j> bon
(03:13:19) <j> il est tard :p
(03:13:25) <g> c'est l'heure de manger
(03:13:38) <j> hm j'ai mangé à 1h moi, j'ai des horaires raisonnables
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-12 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 14:01 [MINIOS PATCH] lib.h: remove BUILD_BUG_ON Wei Liu
2016-08-12 14:02 ` Samuel Thibault [this message]
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=20160812140211.GG3885@var.home \
--to=samuel.thibault@ens-lyon.org \
--cc=minios-devel@lists.xenproject.org \
--cc=wei.liu2@citrix.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.