home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!newsflash.concordia.ca!sifon!thunder.mcrcim.mcgill.edu!mouse
- From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
- Subject: Re: Invalid Code Assumptions in Xt Code
- Message-ID: <1992Nov9.000419.8347@thunder.mcrcim.mcgill.edu>
- Organization: McGill Research Centre for Intelligent Machines
- References: <1992Nov6.164950.4337@spcvxb.spc.edu>
- Date: Mon, 9 Nov 92 00:04:19 GMT
- Lines: 35
-
- In article <1992Nov6.164950.4337@spcvxb.spc.edu>, 4carroll_j@spcvxb.spc.edu writes:
-
- > I don't know who to inform about bugs in the X11R5 distribution,
-
- See mit/bug-report in the distribution.
-
- > The first example of where this is a problem in the module
- > Resources.c in the Xt library. The function _XtDependencies() casts
- > a XtResourceList to a XrmResourceList. If you examine the respective
- > definitions of these two objects you will see that the 5th field of
- > the XtResourceList is a Cardinal object (typedef'ed as an unsigned
- > int), and the 5th field of the XrmResourceList is a long int object.
- > This makes structure pointer arithmatic performed later invalid.
-
- > To correct this situation, you must alter one of the definitions to
- > match the other.
-
- If I might wear my C language lawyer hat for a moment, I am not
- entirely convinced this is sufficient. The rule about unions
- containing structures with common subsequences makes it sound
- reasonable, but I'm not convinced the cast is required to produce a
- usable pointer at all. (I *am* sure that leaving the declarations
- alone is not guaranteed to work even when sizeof(int) == sizeof(long).
- And of course, all of this is pure pickiness; on almost all even
- vaguely sensible machines it'll be no trouble at all.)
-
- > The second mistake is more complicated, but [...]
-
- Sigh. It is not really possible to get this right, because the
- interface to _XtDefaultErrorMsg needs fixing....
-
- der Mouse
-
- mouse@larry.mcrcim.mcgill.edu
-