Should %Ld be replaced with %lld ?
The code below uses% Ld, but in my environment (arm, musl-libc) the Hertz value was not displayed correctly.
proc/sysinfo.c
fprintf(stderr, "Unknown HZ value! (%d) Assume %Ld.\n", h, Hertz);
The above fix supports %Lu, but it looks like %Ld is not.
I made the following modifications in the master branch(8e48eb76) and it now looks as expected.
diff --git a/proc/sysinfo.c b/proc/sysinfo.c
index 5daa70b2..f88016a5 100644
--- a/proc/sysinfo.c
+++ b/proc/sysinfo.c
@@ -245,7 +245,7 @@ static void old_Hertz_hack(void){
/* If 32-bit or big-endian (not Alpha or ia64), assume HZ is 100. */
Hertz = (sizeof(long)==sizeof(int) || htons(999)==999) ? 100UL : 1024UL;
#endif
- fprintf(stderr, "Unknown HZ value! (%d) Assume %Ld.\n", h, Hertz);
+ fprintf(stderr, "Unknown HZ value! (%d) Assume %lld.\n", h, Hertz);
}
}
References: https://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html