https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96594
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is just a user error, you didn't read the XChangeProperty man page.
"If the specified format is 16, the property data must be a short
array. If the specified format is 32, the property data must be a long array."
You are using 32, and I assume you are doing this on 64-bit s390x, i.e. where
long is 64-bit, so while it sounds weird, libX11 requires you to put the
property into a long or unsigned long variable and pass address of that (and
read it through that too).
It kind of "works" on x86_64, because it is little-endian, so you just have
random bits in the upper 32 bits of the long that the library actually reads
and perhaps it casts it to a 32-bit type later on.
But s390x is big endian, so if you call it with address of a 32-bit variable,
the low 32 bits of that are the 32 bits after your variable and can contain
arbitrary random values.