unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#73835: Build failure with gcc 14 and musl on 32 bit
@ 2024-10-16  7:56 Natanael Copa
  2024-10-16  8:02 ` Natanael Copa
  0 siblings, 1 reply; 2+ messages in thread
From: Natanael Copa @ 2024-10-16  7:56 UTC (permalink / raw)
  To: 73835

Hi,

I get this error message when compiling guile 3.0.9 and 3.0.10 with gcc
14 / musl libc on 32 bit Alpine Linux:

filesys.c: In function 'scm_sendfile':
filesys.c:1405:16: error: assignment to 'off_t *' {aka 'long long int *'} from incompatible pointer type 'scm_t_off *' {aka 'long int *'} [-Wincompatible-pointer-types]
 1405 |     offset_ptr = SCM_UNBNDP (offset) ? NULL : &c_offset;
      |                ^

It looks like an assumption that off_t is 32 bit, which is not true on musl libc.

-nc





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#73835: Build failure with gcc 14 and musl on 32 bit
  2024-10-16  7:56 bug#73835: Build failure with gcc 14 and musl on 32 bit Natanael Copa
@ 2024-10-16  8:02 ` Natanael Copa
  0 siblings, 0 replies; 2+ messages in thread
From: Natanael Copa @ 2024-10-16  8:02 UTC (permalink / raw)
  To: 73835

On Wed, 16 Oct 2024 09:56:22 +0200
Natanael Copa <ncopa@alpinelinux.org> wrote:

> Hi,
> 
> I get this error message when compiling guile 3.0.9 and 3.0.10 with gcc
> 14 / musl libc on 32 bit Alpine Linux:
> 
> filesys.c: In function 'scm_sendfile':
> filesys.c:1405:16: error: assignment to 'off_t *' {aka 'long long int *'} from incompatible pointer type 'scm_t_off *' {aka 'long int *'} [-Wincompatible-pointer-types]
>  1405 |     offset_ptr = SCM_UNBNDP (offset) ? NULL : &c_offset;
>       |                ^
> 
> It looks like an assumption that off_t is 32 bit, which is not true on musl libc.
> 
> -nc

This appears to solve it:

diff --git a/libguile/filesys.c b/libguile/filesys.c
index 70a6ef6..0500d45 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -1388,7 +1388,7 @@ SCM_DEFINE (scm_sendfile, "sendfile", 3, 1, 0,
 
   ssize_t result SCM_UNUSED;
   size_t c_count, total = 0;
-  scm_t_off c_offset;
+  off_t c_offset;
   int in_fd, out_fd;
 
   VALIDATE_FD_OR_PORT (out_fd, out, 1);






^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-16  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16  7:56 bug#73835: Build failure with gcc 14 and musl on 32 bit Natanael Copa
2024-10-16  8:02 ` Natanael Copa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).