[tlbuild] proposed change to xdvi.c

Peter Breitenlohner peb at mppmu.mpg.de
Tue Apr 17 09:30:24 CEST 2012


On Mon, 16 Apr 2012, Nelson H. F. Beebe wrote:

> Some debugger work tracked down the cause: in file
> source/texk/xdvik/xdvi.c, at line 3303 the declaration
>
> 	xuint32 data;
>
> needs to be changed to
>
> 	double data;	/* was xuint32, but need 8-byte alignment on some systems */
>
> because &data gets passed into the X11 library via function
> XChangeProperty() and is dereferenced there as an 8-byte value.  ...

Hi Nelson,

good catch, applied as r26011 (however, with long instead of double).

IMHO, this actually is a glitch in libX11, because according to the manpage
data is supposed to be a 32-bit quantity (for format=32).  The actual code,
however, uses '(long *)&data' in that case and thus data should be 8-bit
aligned on 64-bit systems with sizeof(long)=8.  Seems to be a leftover from
times when int was 16-bit.

Regards
Peter Breitenlohner <peb at mppmu.mpg.de>


More information about the tlbuild mailing list