This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada type in binding for C99 bool
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 22 Sep 2009 12:54:33 -0500
- Subject: Re: Ada type in binding for C99 bool
- References: <4AB7DC52.2010305@oarcorp.com> <871vlydi67.fsf@mid.deneb.enyo.de>
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