On Wed, 2023-01-18 at 12:27 +0100, Samuel Thibault wrote:
> Svante Signell, le mer. 18 janv. 2023 11:59:40 +0100, a ecrit:
> > On Wed, 2023-01-18 at 02:02 +0100, Samuel Thibault wrote:
> > > Hello,
> > >
> > >
> > > But conversely when we'll build it in 64bit, vm_page_size
> > > (actually uintptr_t) will be an unsigned long.
> > >
> > > This needs to be fixed the *proper* way: either use the PRIuPTR
> > > macro, or cast the value into unsigned long.
> >
> > Now cast to an unsigned long, new patch attached.
>
> I only took the ext2fs.c part for an example, but it's the same for
> all other files.
I've changed to (unsigned long) everywhere.
(There is also debug code not triggered by normal build needing fixes).
Thanks!
Index: hurd-0.9.git20221224/ext2fs/ext2fs.c
===================================================================
--- hurd-0.9.git20221224.orig/ext2fs/ext2fs.c
+++ hurd-0.9.git20221224/ext2fs/ext2fs.c
@@ -233,7 +233,7 @@ main (int argc, char **argv)
ext2_panic ("device too small for superblock (%Ld bytes)", store->size);
if (store->log2_blocks_per_page < 0)
ext2_panic ("device block size (%zu) greater than page size (%lu)",
- store->block_size, vm_page_size);
+ store->block_size, (unsigned long)vm_page_size);
/* Map the entire disk. */
create_disk_pager ();
Index: hurd-0.9.git20221224/ext2fs/dir.c
===================================================================
--- hurd-0.9.git20221224.orig/ext2fs/dir.c
+++ hurd-0.9.git20221224/ext2fs/dir.c
@@ -417,7 +417,7 @@ dirscanblock (vm_address_t blockaddr, st
{
ext2_warning ("bad directory entry: inode: %Ld offset: %lu",
dp->cache_id,
- currentoff - blockaddr + idx * DIRBLKSIZ);
+ (unsigned long)(currentoff - blockaddr + idx * DIRBLKSIZ));
return ENOENT;
}
Index: hurd-0.9.git20221224/libpager/data-request.c
===================================================================
--- hurd-0.9.git20221224.orig/libpager/data-request.c
+++ hurd-0.9.git20221224/libpager/data-request.c
@@ -49,7 +49,7 @@ _pager_S_memory_object_data_request (str
}
if (length != __vm_page_size)
{
- printf ("incg data request: bad length size %lu\n", length);
+ printf ("incg data request: bad length size %lu\n", (unsigned long)length);
goto release_out;
}
if (offset % __vm_page_size)
Index: hurd-0.9.git20221224/libpager/data-return.c
===================================================================
--- hurd-0.9.git20221224.orig/libpager/data-return.c
+++ hurd-0.9.git20221224/libpager/data-return.c
@@ -60,7 +60,7 @@ _pager_do_write_request (struct pager *p
}
if (length % __vm_page_size)
{
- printf ("incg data return: bad length size %lu\n", length);
+ printf ("incg data return: bad length size %lu\n", (unsigned long)length);
goto release_out;
}
if (offset % __vm_page_size)
Index: hurd-0.9.git20221224/libpager/data-unlock.c
===================================================================
--- hurd-0.9.git20221224.orig/libpager/data-unlock.c
+++ hurd-0.9.git20221224/libpager/data-unlock.c
@@ -58,7 +58,7 @@ _pager_S_memory_object_data_unlock (stru
}
if (length != __vm_page_size)
{
- printf ("incg data unlock: bad length size %lu\n", length);
+ printf ("incg data unlock: bad length size %lu\n", (unsigned long)length);
goto out;
}
Index: hurd-0.9.git20221224/ext2fs/pager.c
===================================================================
--- hurd-0.9.git20221224.orig/ext2fs/pager.c
+++ hurd-0.9.git20221224/ext2fs/pager.c
@@ -643,7 +643,7 @@ pager_unlock_page (struct user_pager_inf
ext2_warning ("This filesystem is out of space.");
else if (err)
ext2_warning ("inode=%Ld, page=0x%lx: %s",
- node->cache_id, page, strerror (err));
+ node->cache_id, (unsigned long)page, strerror (err));
return err;
}
@@ -906,7 +906,7 @@ disk_cache_init (void)
{
if (block_size != vm_page_size)
ext2_panic ("Block size %u != vm_page_size %lu",
- block_size, vm_page_size);
+ block_size, (unsigned long)vm_page_size);
pthread_mutex_init (&disk_cache_lock, NULL);
pthread_cond_init (&disk_cache_reassociation, NULL);
Index: hurd-0.9.git20221224/mach-defpager/main.c
===================================================================
--- hurd-0.9.git20221224.orig/mach-defpager/main.c
+++ hurd-0.9.git20221224/mach-defpager/main.c
@@ -43,6 +43,7 @@
#include <hurd/port.h>
#include <hurd/fd.h>
#include <hurd/paths.h>
+#include <hurd/startup.h>
#include <assert-backtrace.h>
/* XXX */