Skip to content

Commit

Permalink
Add -Wall to CFLAGS and fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Jul 29, 2016
1 parent 8ea46ee commit 9251d25
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION ?= $(shell git describe --tags --dirty)
CFLAGS = -Wextra -DVERSION=\"$(VERSION)\" -g
CFLAGS = -Wall -Wextra -DVERSION=\"$(VERSION)\" -g

.PHONY: earlyoom
earlyoom:
Expand Down
2 changes: 1 addition & 1 deletion kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static struct procinfo get_process_stats(int pid)
p.exited = 1;
return p;
}
fscanf(f, "%*lu %lu", &(p.vm_rss));
fscanf(f, "%*u %lu", &(p.vm_rss));
fclose(f);

return p;
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int main(int argc, char *argv[])
if (m.SwapTotal > 0)
swap_free_percent = m.SwapFree * 100 / m.SwapTotal;

printf("mem avail: %lu MiB (%d %%), swap free: %lu MiB (%d %%)\n",
printf("mem avail: %lu MiB (%ld %%), swap free: %lu MiB (%d %%)\n",
m.MemAvailable / 1024, m.MemAvailable * 100 / m.MemTotal,
m.SwapFree / 1024, swap_free_percent);
c=0;
Expand Down
1 change: 1 addition & 0 deletions meminfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static long get_entry_fatal(const char *name, const char *buf) {
fprintf(stderr, "Could not find \"%s\"\n", name);
exit(104);
}
return val;
}

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

0 comments on commit 9251d25

Please sign in to comment.