Subject: Re: Issues with X11R6 native on NetBSD/sparc
To: None <port-sparc@netbsd.org>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: port-sparc
Date: 09/30/1994 12:58:33
[Half marginally useful suggestions and half ranting...feel free to skip.]

> [X11R6 on NetBSD/sparc]

> 4. a number of times the call to select warns as so:

>     XlibInt.c: In function `_XWaitForWritable':
>     XlibInt.c:252: warning: passing arg 2 of `select' from incompatible pointer type
>     XlibInt.c:252: warning: passing arg 3 of `select' from incompatible pointer type

I started out to say "this is a nonportability in the MIT code", but
then went and had a look.  I'm relived to see they have realized that
select's masks are no longer ints.  It sounds to me as though either
(a) someone is providing an incorrect prototype for select() somehow or
(b) WIN32 is defined when it shouldn't be, or vice versa.  If you run
cc -E on XlibInt.c (with appropriate other options) and examine the
result, you should be able to figure out what's happening by looking
for a prototype for select(), seeing where it comes from, and looking
for the typedef that defines FdSet and thereby seeing which portion of
Xlibnet.h is getting used.

> 5. a smaller number of the old faithful:

>     lcWrap.c: In function `_XlcCopyFromArg':
>     lcWrap.c:466: warning: cast from pointer to integer of different size

Oh, this is really gross.  Casting char * to short, or worse, char?  I
don't know what whoever wrote that code was on, but it [the code]
should be taken out in back of the barn and shot before it infects
anyone else.  (Yes, I know I don't know what it's doing there, or why
it's done that way.  Any interface spec that compels that sort of
sleazy code should itself be taken out and shot.)

> 6. a couple of variable range errors:

>     XSync.c: In function `XSyncInitialize':
>     XSync.c:262: warning: comparison is always 1 due to limited range of data type

This is unfortunate.  The code is entirely correct, both in detail and
conceptually.  (It's comparing a version number, in an unsigned char,
against a manifest constant for the current version number, which is 0,
using >=.  Unsigned chars are always >= 0.)

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu