guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autconf stdint types checking in guile-core


From: Thamer Al-Harbash
Subject: autconf stdint types checking in guile-core
Date: Tue, 15 Apr 2003 15:01:19 -0400 (EDT)

Robert Browning was kind enough to point out on the guile user's
mailing list that guile -current recently got support for C99
stdint types.

I looked at the autoconf tests for the types and would like to
point out that they may break on exceptionally exotic
architectures. The problem is, as most probably know, that the C
standard has always defined sizeof(char) to return 1 byte. The
definition of byte though is not necessarily an 8 bit storage
unit. It's whatever CHAR_BIT is set to via limits.h

Something like this:

if test "$ac_cv_sizeof_int" -eq 4; then
  SCM_I_GSC_T_INT32='"int"'
elif test "$ac_cv_sizeof_long" -eq 4; then
...

May break because 4 in this case may mean 64 bits on a machine
with 16-bit "bytes" where CHAR_BIT is 16.

I'd say doing a sizeof(foo) * value of CHAR_BITS would give you
the total bits and be a better indicator of int8_t, int16_t etc.

This may be overzealous. I'd be glad to submit a patch to the
autoconf tests to detect this more robustly.

-- 
Thamer Al-Harbash            http://www.whitefang.com/
        (if (> pressure too-much-pressure)
                'flame 'work)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]