diff -ruN fakeroot/faked.c fakeroot-upstream-1.30.1/faked.c
--- fakeroot/faked.c	2022-11-14 03:31:24.575795452 +0800
+++ fakeroot-upstream-1.30.1/faked.c	2022-11-14 03:42:12.011891401 +0800
@@ -130,7 +130,7 @@
 #ifdef FAKEROOT_DB_PATH
 # include <dirent.h>
 #endif
-
+#include <inttypes.h>
 #ifndef FAKEROOT_FAKENET
 # define FAKE_KEY msg_key
 #else /* FAKEROOT_FAKENET */
@@ -619,10 +619,10 @@
               (uint64_t) i->buf.mode,(uint64_t) i->buf.uid,(uint64_t) i->buf.gid,
               (uint64_t) i->buf.nlink,(uint64_t) i->buf.rdev,path);
 #else
-    fprintf(f,"dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
-            (uint64_t) i->buf.dev,(uint64_t) i->buf.ino,(uint64_t) i->buf.mode,
-            (uint64_t) i->buf.uid,(uint64_t) i->buf.gid,(uint64_t) i->buf.nlink,
-            (uint64_t) i->buf.rdev);
+    fprintf(f,"dev=%" PRIx64 ",ino=%" PRIu64 ",mode=%" PRIo32 ",uid=%" PRIu32 ",gid=%" PRIu32 ",nlink=%" PRIu32",rdev=%" PRIu64 "\n",
+            i->buf.dev, i->buf.ino, i->buf.mode,
+            i->buf.uid, i->buf.gid, i->buf.nlink,
+            i->buf.rdev);
 #endif
   }
 
@@ -660,7 +660,7 @@
     stdev = path_st.st_dev;
     stino = path_st.st_ino;
 #else
-    r=scanf("dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
+    r=scanf("dev=%" PRIx64 ",ino=%" PRIu64 ",mode=%" PRIo64 ",uid=%" PRIu64 ",gid=%"PRIu64 ",nlink=%" PRIu64 ",rdev=%" PRIu64 "\n",
             &stdev, &stino, &stmode, &stuid, &stgid, &stnlink, &strdev);
     if (r != 7)
       break;
@@ -687,13 +687,13 @@
 /*                               */
 /*********************************/
 void debug_stat(const struct fakestat *st){
-  fprintf(stderr,"dev:ino=(%llx:%lli), mode=0%lo, own=(%li,%li), nlink=%li, rdev=%lli\n",
+  fprintf(stderr,"dev:ino=(%" PRIx64 ":%" PRIx64 "), mode=0%" PRIo32 ", own=(%" PRIi32 ",%" PRIi32 "), nlink=%" PRIi32 ", rdev=%" PRIi64 "\n",
 	  st->dev,
 	  st->ino,
-	  (long)st->mode,
-	  (long)st->uid,
-	  (long)st->gid,
-	  (long)st->nlink,
+	  st->mode,
+	  st->uid,
+	  st->gid,
+	  st->nlink,
 	  st->rdev);
 }
 
