This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Boolean typedefs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]