[gambit-list] Re: C interface: wrong types generated?

Adam Langley agl at imperialviolet.org
Tue Dec 27 16:01:58 EST 2005


On 12/27/05, Bradley Lucier <lucier at math.purdue.edu> wrote:
> The problem seems to be in these lines in gambit.h:
>
> #if CHAR_MAX == SCHAR_MAX
> #define ___SCHAR char
> #else
> #define ___SCHAR signed char
> #endif
>
> I don't know why Marc thinks he needs these lines; I replaced them with
>
> #define ___SCHAR signed char

Since defining ___SCHAR as "signed char" fixes things, that suggests
that it was defined as "char" before. In turn that means that CHAR_MAX
was not equal to SCHAR_MAX. While possible, that's a very odd setup.
Can you create a file which contains the following:

#include <limit.h>

static const a = CHAR_MAX;
static const b = SCHAR_MAX;

and run 'gcc -E <filename>.c'? The last two lines should give the
values of CHAR_MAX and SCHAR_MAX for your system. Generally I would
expect them both to be 127.


AGL

--
Adam Langley                                      agl at imperialviolet.org
http://www.imperialviolet.org                       650-283-9641



More information about the Gambit-list mailing list