All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Welche <prlw1@cam.ac.uk>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: Re: stdbool.h -nostdinc XSA-55 trouble
Date: Thu, 8 Aug 2013 18:26:55 +0100	[thread overview]
Message-ID: <20130808172655.GH870@quark> (raw)
In-Reply-To: <1375978371.14651.12.camel@kazak.uk.xensource.com>

On Thu, Aug 08, 2013 at 05:12:51PM +0100, Ian Campbell wrote:
> (adding Ian J who did most of XSA-55)
> On Thu, 2013-08-08 at 16:47 +0100, Patrick Welche wrote:
> > On Thu, Aug 08, 2013 at 04:30:06PM +0100, Jan Beulich wrote:
> > > No, according to my checking, the --prefix configure option
> > > listed does not correlate with the directory where the header
> > > is found.
> > 
> > Yes - I think our emails crossed...
> > 
> > The underlying problem is:
> > 
> > Linux:   /usr/lib/gcc/i?86-linux-gnu/n.m/include/stdbool.h
> > NetBSD:  /usr/include/stdbool.h
> 
> The hypervisor side, which is where --nostdinc is used, has it's own
> bool_t in asm/types.h. Perhaps libelf (which is supposed to compile for
> both user and hypervisor space) should be using
> #ifdef __XEN__
> #include <asm/types.h>
> #else
> #include <stdbool.h>
> #endif
> 
> ?
> 
> I'd be a bit concerned about the fact that Xen's bool_t is a typedef for
> char, as opposed to the compilers typedef to _Bool which has special
> meaning. It may not matter in practice but might the fact that _Bool
> canonicalises to 0 or 1 vs. 0 or !0 cause something subtle?

AFAIK

char c=0;
!c == 1 (true) (rather than 0xff or ~c or whatever - but this is without
                a "malicious compiler")

so at a glance, this seems OK. (But then I don't know the original
motivation for replacing bools in XSA-55...)

Cheers,

Patrick

  reply	other threads:[~2013-08-08 17:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 11:49 stdbool.h -nostdinc XSA-55 trouble Patrick Welche
2013-08-08 13:11 ` Jan Beulich
2013-08-08 15:18   ` Patrick Welche
2013-08-08 15:23     ` Ian Campbell
2013-08-08 15:39       ` Patrick Welche
2013-08-14  9:36       ` Egger, Christoph
2013-08-08 15:30     ` Jan Beulich
2013-08-08 15:47       ` Patrick Welche
2013-08-08 16:12         ` Ian Campbell
2013-08-08 17:26           ` Patrick Welche [this message]
2013-08-08 19:05             ` Andrew Cooper
2013-08-08 19:24               ` Ian Campbell
2013-08-08 19:52                 ` Andrew Cooper
2013-08-09  7:50           ` Jan Beulich
2013-08-09  8:11             ` Patrick Welche
2013-08-09  8:16               ` Jan Beulich
2013-08-09  8:32                 ` Patrick Welche
2013-08-09  8:33               ` Patrick Welche
2013-08-09  8:40                 ` Jan Beulich
2013-08-09 15:13                   ` Tim Deegan
2013-08-11 15:21                     ` Patrick Welche
2013-08-09  6:44         ` Jan Beulich
2013-08-09  7:55           ` Patrick Welche
2013-08-11 16:41           ` Patrick Welche
2013-08-12  7:31             ` Jan Beulich

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=20130808172655.GH870@quark \
    --to=prlw1@cam.ac.uk \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.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.