This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Boolean typedefs
- From: Jonathan Larmour <jifl at jifvik dot org>
- To: Alan Bowman <alan dot michael dot bowman at gmail dot com>
- Cc: ecos-patches at ecos dot sourceware dot org
- Date: Thu, 13 May 2010 14:42:23 +0100
- Subject: Re: Boolean typedefs
- References: <AANLkTikWoQgHwnJVY6Q4tYL0m1oQ8is_FRMVetG32JrV@mail.gmail.com>
On 12/05/10 20:47, Alan Bowman wrote:
> A few weeks ago, I posted a query about booleans on the ecos-discuss
> list (http://ecos.sourceware.org/ml/ecos-discuss/2010-04/msg00035.html).
> There were no comments either way, so here's a patch. It should
> mean that all booleans end up using GCC's _Bool type, instead of a mix
> of _Bool and int. It showed up a couple of places where a function
> prototype didn't match the implementation, and this patch fixes them.
>
> Do others think that there was a problem with boolean definitions, and
> is this an appropriate fix?
This might be tricky. I remember that early on in eCos development, we
started using GCC's boolean type. We had a problem that the type was
considered differently between GCC's C and C++ front-ends. The result was
that places where they were passed around - particularly in the kapidata.h
stuff - they could end up being either different sizes or aligned
differently in structures.
Now GCC has moved on a lot since then, so this problem may well have gone
away and probably has, but that's what I for one would prefer to have
confidence about - ABI compatibility between C and C++ boolean types. But
is there any way to get that confidence in practice, or is it just going
to have to be a case of "suck it and see"? Do you have any thoughts? Have
you run the kernel tests (particularly the k* ones)?
Jifl
--
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine