Skip to content

Commit 9251d25

Browse files
committed
Add -Wall to CFLAGS and fix warnings
1 parent 8ea46ee commit 9251d25

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VERSION ?= $(shell git describe --tags --dirty)
2-
CFLAGS = -Wextra -DVERSION=\"$(VERSION)\" -g
2+
CFLAGS = -Wall -Wextra -DVERSION=\"$(VERSION)\" -g
33

44
.PHONY: earlyoom
55
earlyoom:

kill.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static struct procinfo get_process_stats(int pid)
8383
p.exited = 1;
8484
return p;
8585
}
86-
fscanf(f, "%*lu %lu", &(p.vm_rss));
86+
fscanf(f, "%*u %lu", &(p.vm_rss));
8787
fclose(f);
8888

8989
return p;

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
128128
if (m.SwapTotal > 0)
129129
swap_free_percent = m.SwapFree * 100 / m.SwapTotal;
130130

131-
printf("mem avail: %lu MiB (%d %%), swap free: %lu MiB (%d %%)\n",
131+
printf("mem avail: %lu MiB (%ld %%), swap free: %lu MiB (%d %%)\n",
132132
m.MemAvailable / 1024, m.MemAvailable * 100 / m.MemTotal,
133133
m.SwapFree / 1024, swap_free_percent);
134134
c=0;

meminfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ static long get_entry_fatal(const char *name, const char *buf) {
3232
fprintf(stderr, "Could not find \"%s\"\n", name);
3333
exit(104);
3434
}
35+
return val;
3536
}
3637

3738
/* If the kernel does not provide MemAvailable (introduced in Linux 3.14),

0 commit comments

Comments
 (0)