NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/59711: "#define HAVE_UNISTD_H 1" breaks 32-bit libz
The following reply was made to PR lib/59711; it has been noted by GNATS.
From: Tom Lane <tgl%sss.pgh.pa.us@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: lib/59711: "#define HAVE_UNISTD_H 1" breaks 32-bit libz
Date: Sun, 19 Oct 2025 00:29:09 -0400
Oh! I suddenly realized why it appears to be fine on evbarm:
there's an endianness dependency. The gzgetc() macro just wants
to increment the pos field, and if the machine is little-endian
then it doesn't matter too much whether it thinks pos is 32 or
64 bits. (It would matter in the event of overflow of the
32-bit value, but that won't happen.) But macppc is big-endian,
so if gzgetc() thinks pos is 64 bits then it will actually increment
what the library thinks is the "mode" field, setting off subsequent
sanity checks.
So this is probably only a live issue on 32-bit big-endian platforms.
regards, tom lane
Home |
Main Index |
Thread Index |
Old Index