From xemacs-m  Sat Jun 21 01:05:13 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id BAA17394
	for <xemacs-beta@xemacs.org>; Sat, 21 Jun 1997 01:05:11 -0500 (CDT)
Received: from Eng.Sun.COM ([129.146.1.25]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA06260; Fri, 20 Jun 1997 23:27:00 -0700
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id XAA03048; Fri, 20 Jun 1997 23:04:39 -0700
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id XAA10947; Fri, 20 Jun 1997 23:04:38 -0700
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id XAA07502; Fri, 20 Jun 1997 23:04:35 -0700
Date: Fri, 20 Jun 1997 23:04:35 -0700
Message-Id: <199706210604.XAA07502@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Olivier Galibert <Olivier.Galibert@mines.u-nancy.fr>
Cc: XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: Yet more 64bits lossage
In-Reply-To: <19970621012424.18989@iria.mines.u-nancy.fr>
References: <19970621012424.18989@iria.mines.u-nancy.fr>
X-Mailer: VM 6.32 under 20.3 "Oslo" XEmacs Lucid (beta7)
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

>>>>> "OG" == Olivier Galibert <Olivier.Galibert@mines.u-nancy.fr> writes:

OG> If you end the parameter list of a XtVa* call by 0 instead
OG> of null, you'll crash in 64bits mode on Irix.

Congratulations!  This is the kind of sloppiness they always warned us 
about, but we never had to take seriously.

Your patch is not quite correct, since NULL might legally be 
#define NULL 0
instead of
#define NULL ((void *) 0)
as it presumably is on SGI's.

Hmmmmmmmm....penser....

Here's what I recommend:

Replace all calls to XtVa[SG]etValues by calls to Xt[SG]etValues.
These calls are less convenient, but more efficient and more portable, 
because all the calls will be properly type-checked.  I am willing to
make this change, or you can make it.  Let me know.  

O'Reilly Xt Reference says:

Variable-length argument lists cannot be type-checked by the compiler, 
and so using XtVaSetValues() and other varargs functions can be a
source of bugs.

We should never call any of the XtVa* convenience functions.

OG>   OG.

OG> PS: It eventually works ! Joy joy joy :-)
OG> --- lwlib/lwlib-Xaw.c.orig	Sat Jun 21 00:58:30 1997
OG> +++ lwlib/lwlib-Xaw.c	Sat Jun 21 01:00:42 1997
OG> @@ -75,7 +75,7 @@
OG>  		     XtNy, data->scrollbar_y,
OG>  		     XtNwidth, data->scrollbar_width,
OG>  		     XtNheight, data->scrollbar_height,
OG> -		     0);
OG> +		     NULL);
 
Martin

