summaryrefslogtreecommitdiff
path: root/src/user/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/app')
-rw-r--r--src/user/app/iochk/iochk.c8
-rw-r--r--src/user/app/iostress/iostress.c4
-rw-r--r--src/user/app/shell/builtins.c4
-rw-r--r--src/user/app/shell/shell.c2
-rw-r--r--src/user/app/tests/shared/printf.c2
-rw-r--r--src/user/app/tests/tests.c2
6 files changed, 12 insertions, 10 deletions
diff --git a/src/user/app/iochk/iochk.c b/src/user/app/iochk/iochk.c
index 9703919..0850821 100644
--- a/src/user/app/iochk/iochk.c
+++ b/src/user/app/iochk/iochk.c
@@ -30,7 +30,7 @@ void check(hid_t h) {
long offlast = 0;
long retlast = _sys_read(h, buflast, buflen, offlast);
if (retlast < 0) {
- eprintf("error %d when reading at offset %d", retlast, offlast);
+ eprintf("error %ld when reading at offset %ld", retlast, offlast);
goto end;
}
@@ -43,14 +43,14 @@ void check(hid_t h) {
long retcur = _sys_read(h, bufcur, buflen, offcur);
if (retcur < 0) {
- eprintf("error %d when reading at offset %d", retlast, offcur);
+ eprintf("error %ld when reading at offset %ld", retlast, offcur);
break;
}
if (retcur < retlast + offlast - offcur) {
- verbosef("warn: unexpected ret %d < %d + %d - %d\n", retcur, retlast, offlast, offcur);
+ verbosef("warn: unexpected ret %ld < %ld + %ld - %ld\n", retcur, retlast, offlast, offcur);
}
if (memcmp(buflast + diff, bufcur, retlast - diff)) {
- eprintf("unconsistent read from offsets %d and %d", offlast, offcur);
+ eprintf("inconsistent read from offsets %ld and %ld", offlast, offcur);
}
offlast = offcur;
diff --git a/src/user/app/iostress/iostress.c b/src/user/app/iostress/iostress.c
index 3a3a23c..ac555de 100644
--- a/src/user/app/iostress/iostress.c
+++ b/src/user/app/iostress/iostress.c
@@ -35,9 +35,9 @@ int main(int argc, char **argv) {
for (long i = 0; i < num_runs; i++) {
uint64_t scaled = results[i] / 3000;
total += scaled;
- fprintf(stderr, "run %u: %u\n", i, scaled);
+ fprintf(stderr, "run %ld: %lu\n", i, scaled);
}
- fprintf(stderr, "%u calls, %u bytes. avg %u\n", num_calls, num_bytes, total / num_runs);
+ fprintf(stderr, "%lu calls, %lu bytes. avg %lu\n", num_calls, num_bytes, total / num_runs);
return 0;
}
diff --git a/src/user/app/shell/builtins.c b/src/user/app/shell/builtins.c
index e0f848e..734370b 100644
--- a/src/user/app/shell/builtins.c
+++ b/src/user/app/shell/builtins.c
@@ -125,7 +125,7 @@ void cmd_hexdump(int argc, char **argv) {
}
continue;
} else skipped = false;
- printf("%08x ", pos + i);
+ printf("%08zx ", pos + i);
for (size_t j = i; j < i + 8 && j < len; j++)
printf("%02x ", buf[j]);
@@ -148,7 +148,7 @@ void cmd_hexdump(int argc, char **argv) {
}
pos += len;
}
- printf("%08x\n", pos);
+ printf("%08zx\n", pos);
fclose(file);
}
}
diff --git a/src/user/app/shell/shell.c b/src/user/app/shell/shell.c
index 5808de1..d2d7e37 100644
--- a/src/user/app/shell/shell.c
+++ b/src/user/app/shell/shell.c
@@ -72,7 +72,7 @@ void run_args(int argc, char **argv, struct redir *redir) {
uint64_t div = 3000;
run_args(argc - 1, argv + 1, redir);
time = __rdtsc() - time;
- printf("%u ns (assuming 3GHz)\n", time / div);
+ printf("%lu ns (assuming 3GHz)\n", time / div);
return;
} else if (!strcmp(argv[0], "exit")) {
exit(0);
diff --git a/src/user/app/tests/shared/printf.c b/src/user/app/tests/shared/printf.c
index 71122f5..d8df48a 100644
--- a/src/user/app/tests/shared/printf.c
+++ b/src/user/app/tests/shared/printf.c
@@ -2,6 +2,8 @@
#include <stdio.h>
#include <string.h>
+#pragma GCC diagnostic ignored "-Wformat-truncation"
+
static void test_printf(void) {
char buf[64];
memset(buf, '?', 64);
diff --git a/src/user/app/tests/tests.c b/src/user/app/tests/tests.c
index 7139fc7..2cb97cd 100644
--- a/src/user/app/tests/tests.c
+++ b/src/user/app/tests/tests.c
@@ -15,7 +15,7 @@ void run_test(void (*fn)()) {
} else {
/* successful tests must return 0 */
if (_sys_await() != 0) {
- test_failf("%p, base %p", (void*)fn - (void*)_image_base, _image_base);
+ test_failf("%p, base %p", (void*)((void*)fn - (void*)_image_base), _image_base);
}
}
}