Article View: comp.emacs
Article #89Re: Warning when Building in OpenBSD 8.0
From: Lawrence D’Oliveiro
Date: Thu, 12 Nov 2026 21:09
Date: Thu, 12 Nov 2026 21:09
29 lines
2468 bytes
2468 bytes
On Thu, 5 Nov 2026 16:16:57 +0000, Roderick wrote: > CC marker.o > CC minibuf.o > CC fileio.o > /usr/opt/Emacs-31.1/emacs-31.1/src/fileio.c:3960:31: warning: implicit > conversion from 'off_t' (aka 'long long') to 'double' changes value > from > 9223372036854775807 to 9223372036854775808 > [-Wimplicit-const-int-float-conversion] > 3960 | if (0 <= v && v < 1.0 + TYPE_MAXIMUM (off_t)) > | ~ ^~~~~~~~~~~~~~~~~~~~ > [etc] Thinking about these expressions, they are not just too clever for words, they are just plain wrong. Think about it: off_t is typically 64 bits nowadays. But double-precision reals only have about 53 bits of precision. So once a real gets beyond ±2**52, it will no longer be able to express a file offset accurately to the nearest byte. Where is there a file format that can tolerate misplacement of data that is off by a few bytes, or worse still, a few K? There isn’t one: you’ve got to be able to express byte offsets exactly, otherwise you will suffer data corruption. So the code should be fixed to not accept real values beyond the range that can exactly represent integers. To be safe, I think it should not be accepting real values for file offsets at all.
Technical Details
Message-ID:
<11d59uh$8idc$10@dont-email.me>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<d466f0a1-43c2-c6f7-4587-db3f6747ce0c@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.emacs Subject: Re: Warning when Building in OpenBSD 8.0 Date: Thu, 12 Nov 2026 21:09:37 -0000 (UTC) Organization: A noiseless patient Spider Lines: 29 Message-ID: <11d59uh$8idc$10@dont-email.me> References: <d466f0a1-43c2-c6f7-4587-db3f6747ce0c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 12 Nov 2026 21:09:38 +0000 (UTC) Injection-Info: dont-email.me; logging-data="281004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XstZkBehrrdySbtjvpTWW"; posting-host="33d00acd775bfe61d11222a1d44a73f8" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:2757sx6UjO0L/QOLpVAhKP8iNZ4= sha256:7JSjq88pomZeIaXFOYIiDPREjdd77o+IskXB2xslK+U= sha1:bcPdlvyOh8/xIpqWtgOmIaA7TXA= sha256:sQFWXu8agYScKDA8aqdioYn9PfUdn/6NdowycLdapqA=