This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Ada type in binding for C99 bool


Florian Weimer wrote:
* Joel Sherrill:

What is the proper type to use in an Ada binding
for a C method that returns a C99 bool?

Whatever the answer is, it should be used to define Interfaces.C.Bool. (I don't know what GCC's options for representing _Bool are, sorry.)

It appears to be unsigned char or at least sizeof(bool)=1
on the architectures I tried this test program on.

#include <stdbool.h>

bool x;
int s = sizeof(bool);

Unfortunately bool is defined to _Bool and that must be
something gcc recognizes.  I don't see it in .h files.

So I am only slightly more sure of it than you are. :)

--joel


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