unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* autconf stdint types checking in guile-core
@ 2003-04-15 19:01 Thamer Al-Harbash
  2003-04-16  5:54 ` Rob Browning
  2003-04-16  6:16 ` Rob Browning
  0 siblings, 2 replies; 7+ messages in thread
From: Thamer Al-Harbash @ 2003-04-15 19:01 UTC (permalink / raw)


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)


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-04-16 16:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-15 19:01 autconf stdint types checking in guile-core Thamer Al-Harbash
2003-04-16  5:54 ` Rob Browning
2003-04-16  6:16 ` Rob Browning
2003-04-16  7:28   ` Thamer Al-Harbash
2003-04-16  8:59     ` tomas
2003-04-16 12:11   ` Marius Vollmer
2003-04-16 16:22     ` Rob Browning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).