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


> 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)?

I hadn't considered the difference between C and C++.  I noticed this
as an issue when passing function pointers between non-eCos code (i.e.
using bools from stdbool.h) and eCos code (that was using built-in
bools), and I'm only using C in my application.

I think that there's two issues that are addressed in my patch - the
first is that there are some functions that have different prototypes
(bool/int mixup) that isn't an issue as long as bool typedefs to int,
but is an issue if something else happens.  This seems to me like an
obvious (if minor) thing to fix.

The second issue of which bool to use is one that I've got less
answers for.  I can't provide any real confidence that GCC handles C
and C++ bools in the same way across all platforms.  I am actually
using a slightly older eCos code base than top-of-trunk (or is that
"tip"), but I made sure that my changes applied in a reasonable
manner.  I haven't run any of the tests, although I'll give that a try
as soon as I can get my hands on some development hardware.


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