From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthias Koeppe Newsgroups: gmane.lisp.guile.devel Subject: Re: Portability bug with UINTPTR_MAX in Solaris/Forte Date: Mon, 23 Jun 2003 11:15:27 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87isr0cjlb.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1056359837 27143 80.91.224.249 (23 Jun 2003 09:17:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 23 Jun 2003 09:17:17 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 23 11:17:16 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19UNRr-00073e-00 for ; Mon, 23 Jun 2003 11:17:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19UNQu-0005h3-Hb for guile-devel@m.gmane.org; Mon, 23 Jun 2003 05:16:16 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19UNQQ-0005OV-4l for guile-devel@gnu.org; Mon, 23 Jun 2003 05:15:46 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19UNQM-0005JU-Fl for guile-devel@gnu.org; Mon, 23 Jun 2003 05:15:43 -0400 Original-Received: from merkur.math.uni-magdeburg.de ([141.44.75.40]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19UNQ8-0005CI-Tw for guile-devel@gnu.org; Mon, 23 Jun 2003 05:15:29 -0400 Original-Received: from beta ([141.44.75.78] helo=beta.math.uni-magdeburg.de) by merkur.math.uni-magdeburg.de with esmtp (Exim 4.10) id 19UNQ8-0005wY-00 for guile-devel@gnu.org; Mon, 23 Jun 2003 11:15:28 +0200 Original-Received: (from mkoeppe@localhost) by beta.math.uni-magdeburg.de (8.11.7+Sun/8.11.7) id h5N9FRn21108; Mon, 23 Jun 2003 11:15:27 +0200 (MEST) X-Authentication-Warning: beta.math.uni-magdeburg.de: mkoeppe set sender to mkoeppe@mail.math.uni-magdeburg.de using -f Original-To: guile-devel@gnu.org In-Reply-To: <87isr0cjlb.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 21 Jun 2003 11:20:16 +1000") Original-Lines: 45 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.3.50 (sparc-sun-solaris2.8) X-Warning: no 'abuse'-account in domain mail.math.uni-magdeburg.de (cf. RFC2142/4.) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2573 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2573 Kevin Ryde writes: > Matthias Koeppe writes: >> >> On Solaris, there is a uintptr_t, and UINTPTR_MAX is also a defined >> macro, but it expands to nothing. > > Literally nothing? Perhaps the change below would do the trick. > Does the same apply to INTPTR_MAX? Thanks, your trick does the change. (I still think that tricky things like this should be checked at `configure' time, rather than during compilation, though.) The same does not apply to the signed version because INTPTR_MIN is not defined at all. I have updated your patch to check this anyway, for "completeness". --- tags.h.~1.103.~ Mon Jun 16 16:50:07 2003 +++ tags.h Mon Jun 23 11:13:09 2003 @@ -39,7 +39,11 @@ /* In the beginning was the Word: */ -#if SCM_SIZEOF_INTPTR_T != 0 && defined(INTPTR_MAX) && defined(INTPTR_MIN) +/* On Solaris 7 and 8, /usr/include/sys/int_limits.h defines + INTPTR_MAX and UINTPTR_MAX to empty, INTPTR_MIN is not defined. + To avoid uintptr_t and intptr_t in this case we require + UINTPTR_MAX-0 != 0 etc. */ +#if SCM_SIZEOF_INTPTR_T != 0 && defined(INTPTR_MAX) && defined(INTPTR_MIN) && INTPTR_MAX-0 != 0 && INTPTR_MIN-0 != 0 typedef intptr_t scm_t_signed_bits; #define SCM_T_SIGNED_BITS_MAX INTPTR_MAX #define SCM_T_SIGNED_BITS_MIN INTPTR_MIN @@ -49,7 +53,7 @@ #define SCM_T_SIGNED_BITS_MIN LONG_MIN #endif -#if SCM_SIZEOF_UINTPTR_T != 0 && defined(UINTPTR_MAX) +#if SCM_SIZEOF_UINTPTR_T != 0 && defined(UINTPTR_MAX) && UINTPTR_MAX-0 != 0 typedef uintptr_t scm_t_bits; #define SIZEOF_SCM_T_BITS SCM_SIZEOF_UINTPTR_T #define SCM_T_BITS_MAX UINTPTR_MAX -- Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel