🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

4 total messages Started by Roderick Thu, 05 Nov 2026 16:16
Warning when Building in OpenBSD 8.0
#63
Author: Roderick
Date: Thu, 05 Nov 2026 16:16
70 lines
3449 bytes
   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))
       |                             ~ ^~~~~~~~~~~~~~~~~~~~
/usr/opt/Emacs-31.1/emacs-31.1/lib/intprops.h:56:4: note: expanded from 
macro
       'TYPE_MAXIMUM'
    56 |   ((t) (! TYPE_SIGNED (t) 
\
       | 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    57 |   ...? (t) -1 
\
       | 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    58 |         : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
   CC       dired.o
   CC       cmds.o
   CC       casetab.o
   CC       casefiddle.o
   CC       indent.o
   CC       search.o
   CC       regex-emacs.o
   CC       undo.o
   CC       alloc.o
/usr/opt/Emacs-31.1/emacs-31.1/src/alloc.c:5718:18: warning: implicit 
conversion
       from 'long' to 'double' changes value from 4611686018427387903 to
       4611686018427387904 [-Wimplicit-const-int-float-conversion]
  5718 |               if (tot < HI_THRESHOLD)
       |                       ~ ^~~~~~~~~~~~
/usr/opt/Emacs-31.1/emacs-31.1/src/alloc.c:304:37: note: expanded from 
macro
       'HI_THRESHOLD'
   304 | #define HI_THRESHOLD (EMACS_INT_MAX / 2)
       |                       ~~~~~~~~~~~~~~^~~
1 warning generated.

   CC       editfns.o
/usr/opt/Emacs-31.1/emacs-31.1/src/editfns.c:4019:21: warning: implicit
       conversion from 'unsigned long long' to 'double' changes value from
       18446744073709551615 to 18446744073709551616
       [-Wimplicit-const-int-float-conversion]
  4019 |                       if (abs_d < UINTMAX_MAX + 1.0)
       |                                   ^~~~~~~~~~~ ~
/usr/include/sys/stdint.h:171:22: note: expanded from macro 'UINTMAX_MAX'
   171 | #define UINTMAX_MAX             UINT64_MAX
       |                                 ^~~~~~~~~~
/usr/include/sys/stdint.h:123:21: note: expanded from macro 'UINT64_MAX'
   123 | #define UINT64_MAX              0xffffffffffffffffULL
       |                                 ^~~~~~~~~~~~~~~~~~~~~
1 warning generated.
   CC       callint.o
   CC       eval.o

----

Other warnings passed to fast

----
Re: Warning when Building in OpenBSD 8.0
#64
Author: Lawrence D’Oliveiro
Date: Thu, 05 Nov 2026 23:08
5 lines
1300 bytes
On Thu, 5 Nov 2026 16:16:57 +0000, Roderick wrote:

> Other warnings passed to fast

No scrollback?
Re: Warning when Building in OpenBSD 8.0
#65
Author: Lawrence D’Oliveiro
Date: Fri, 06 Nov 2026 00:40
16 lines
1884 bytes
On Thu, 5 Nov 2026 16:16:57 +0000, Roderick wrote:

> /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]

One the one hand, you could argue that this kind of arithmetic trickery
is sailing a bit close to the wind.

But on the other hand, once you hit that precision limit, the addition
of 1.0 doesn’t make any difference anyway ...
Re: Warning when Building in OpenBSD 8.0
#89
Author: Lawrence D’Oliveiro
Date: Thu, 12 Nov 2026 21:09
29 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads