unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Thamer Al-Harbash <tmh@whitefang.com>
Subject: autconf stdint types checking in guile-core
Date: Tue, 15 Apr 2003 15:01:19 -0400 (EDT)	[thread overview]
Message-ID: <Pine.BSF.4.51.0304151446160.86988@helena.whitefang.com> (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


             reply	other threads:[~2003-04-15 19:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-15 19:01 Thamer Al-Harbash [this message]
2003-04-16  5:54 ` autconf stdint types checking in guile-core 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.BSF.4.51.0304151446160.86988@helena.whitefang.com \
    --to=tmh@whitefang.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).