🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #25491

Xlib portability problem (padded structures)

#25491
From: Bruce Morgan
Date: Mon, 27 Apr 1987 18:27
26 lines
1771 bytes
I have only been reading this news group for a month so excuse me if this
problem has been answered before.

I am currently running the X10R3 server on a Sun 3/50 and have been trying
to port clients to a CCI Power 6/32 running a hybrid of System V.2 and BSD4.2.
The compiler I am using on the 6/32 pads various parts of structures to
4 byte boundaries thus leaving "holes" as mentioned on page 130 of K&R.
Unfortunately, the XDraw family of Xlib routines are written in a non-
portable way that assumes structures are densely packed.  They cast an
array of Vertex structures into a character array and just send it as is.
This sends the padding along with the data.

I also noticed that both Xlib and the Server use structures in a non-
portable way to format the data sent or received on the network connection.
This was not a problem in my case, but could be on other systems.

Has anyone else had similar porting problems?  I have been told that the
AT&T 3B2 compiler does a similar type of structure padding, but I have not
used that machine myself.  Was this fixed in X10R4?  Will it be fixed in X.11?

---
Bruce Morgan

usenet: seismo!rlgvax!bruce
USmail: Computer Consoles, Inc., 11490 Commerce Park Drive, Reston, VA 22091
Phone:  (703)648-3300
Technical Details
Message-ID: <420@rlgvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rlgvax!bruce

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rlgvax!bruce
From: bruce@rlgvax.UUCP (Bruce Morgan)
Newsgroups: comp.windows.x
Subject: Xlib portability problem (padded structures)
Message-ID: <420@rlgvax.UUCP>
Date: Mon, 27-Apr-87 14:27:49 EDT
Article-I.D.: rlgvax.420
Posted: Mon Apr 27 14:27:49 1987
Date-Received: Tue, 28-Apr-87 02:08:26 EDT
Organization: Computer Consoles Inc, Reston VA
Lines: 26
Keywords: portability, structure padding