aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Peter Millerchip <pete@millerchipsoftware.com>2015-08-20 14:38:44 +0100
committerLibravatar Peter Millerchip <pete@millerchipsoftware.com>2015-08-20 14:38:44 +0100
commit48af0110f88d63bc351579974ceafde352ebe8e2 (patch)
tree806b45a3c1ab0c7e676b5168ee84f2dfd743bd8f
parentMerge pull request #34 from pmillerchip/make-install (diff)
downloadfirejail-48af0110f88d63bc351579974ceafde352ebe8e2.tar.gz
firejail-48af0110f88d63bc351579974ceafde352ebe8e2.tar.zst
firejail-48af0110f88d63bc351579974ceafde352ebe8e2.zip
Compile with -W -Wall -Werror
-rw-r--r--src/firejail/Makefile.in2
-rw-r--r--src/firejail/fs.c2
-rw-r--r--src/firejail/main.c4
-rw-r--r--src/firejail/netfilter.c2
-rw-r--r--src/firejail/profile.c2
-rw-r--r--src/firejail/sandbox.c3
-rw-r--r--src/firejail/seccomp.c2
-rw-r--r--src/firejail/util.c5
-rw-r--r--src/firemon/Makefile.in2
-rw-r--r--src/firemon/firemon.c3
-rw-r--r--src/firemon/netstats.c2
-rw-r--r--src/firemon/top.c11
-rw-r--r--src/ftee/Makefile.in2
-rw-r--r--src/lib/Makefile.in2
-rw-r--r--src/lib/libnetlink.c16
-rw-r--r--src/lib/pid.c20
-rw-r--r--src/libtrace/Makefile.in2
17 files changed, 49 insertions, 33 deletions
diff --git a/src/firejail/Makefile.in b/src/firejail/Makefile.in
index 1f7b563c4..fca86be4d 100644
--- a/src/firejail/Makefile.in
+++ b/src/firejail/Makefile.in
@@ -12,7 +12,7 @@ H_FILE_LIST = $(wildcard *.[h])
12C_FILE_LIST = $(wildcard *.c) 12C_FILE_LIST = $(wildcard *.c)
13OBJS = $(C_FILE_LIST:.c=.o) 13OBJS = $(C_FILE_LIST:.c=.o)
14BINOBJS = $(foreach file, $(OBJS), $file) 14BINOBJS = $(foreach file, $(OBJS), $file)
15CFLAGS += -ggdb -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(PREFIX)"' $(HAVE_SECCOMP) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_BIND) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security 15CFLAGS += -ggdb -W -Wall -Werror -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(PREFIX)"' $(HAVE_SECCOMP) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_BIND) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
16LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread 16LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
17 17
18%.o : %.c $(H_FILE_LIST) 18%.o : %.c $(H_FILE_LIST)
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index 38946c8d9..428ea0819 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -199,7 +199,7 @@ static void globbing(OPERATION op, const char *fname, const char *emptydir, cons
199 glob_t globbuf; 199 glob_t globbuf;
200 globbuf.gl_offs = 0; 200 globbuf.gl_offs = 0;
201 glob(fname, GLOB_DOOFFS, NULL, &globbuf); 201 glob(fname, GLOB_DOOFFS, NULL, &globbuf);
202 int i; 202 unsigned int i;
203 for (i = 0; i < globbuf.gl_pathc; i++) { 203 for (i = 0; i < globbuf.gl_pathc; i++) {
204 assert(globbuf.gl_pathv[i]); 204 assert(globbuf.gl_pathv[i]);
205 disable_file(op, globbuf.gl_pathv[i], emptydir, emptyfile); 205 disable_file(op, globbuf.gl_pathv[i], emptydir, emptyfile);
diff --git a/src/firejail/main.c b/src/firejail/main.c
index 3c7a8401e..14a5d9d47 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -175,7 +175,7 @@ static inline Bridge *last_bridge_configured(void) {
175static int read_pid(char *str, pid_t *pid) { 175static int read_pid(char *str, pid_t *pid) {
176 char *endptr; 176 char *endptr;
177 errno = 0; 177 errno = 0;
178 pid_t pidtmp = strtol(str, &endptr, 10); 178 long int pidtmp = strtol(str, &endptr, 10);
179 if ((errno == ERANGE && (pidtmp == LONG_MAX || pidtmp == LONG_MIN)) 179 if ((errno == ERANGE && (pidtmp == LONG_MAX || pidtmp == LONG_MIN))
180 || (errno != 0 && pidtmp == 0)) { 180 || (errno != 0 && pidtmp == 0)) {
181 return 1; 181 return 1;
@@ -183,7 +183,7 @@ static int read_pid(char *str, pid_t *pid) {
183 if (endptr == str) { 183 if (endptr == str) {
184 return 1; 184 return 1;
185 } 185 }
186 *pid = pidtmp; 186 *pid = (pid_t)pidtmp;
187 return 0; 187 return 0;
188} 188}
189 189
diff --git a/src/firejail/netfilter.c b/src/firejail/netfilter.c
index fd8a9b2f3..da13d8092 100644
--- a/src/firejail/netfilter.c
+++ b/src/firejail/netfilter.c
@@ -79,7 +79,7 @@ void netfilter(const char *fname) {
79 } 79 }
80 80
81 size_t sz = fread(filter, 1, s.st_size, fp); 81 size_t sz = fread(filter, 1, s.st_size, fp);
82 if (sz != s.st_size) { 82 if ((off_t)sz != s.st_size) {
83 fprintf(stderr, "Error: cannot read network filter file\n"); 83 fprintf(stderr, "Error: cannot read network filter file\n");
84 exit(1); 84 exit(1);
85 } 85 }
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 39b0710cb..e9a2e55a3 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -69,7 +69,7 @@ static void check_file_name(char *ptr, int lineno) {
69 69
70 int len = strlen(ptr); 70 int len = strlen(ptr);
71 // file globbing ('*') is allowed 71 // file globbing ('*') is allowed
72 if (strcspn(ptr, "\\&!?\"'<>%^(){}[];,") != len) { 72 if (strcspn(ptr, "\\&!?\"'<>%^(){}[];,") != (size_t)len) {
73 if (lineno == 0) 73 if (lineno == 0)
74 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr); 74 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr);
75 else 75 else
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index 2cdc67d1c..a97b3e77b 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -130,6 +130,9 @@ static void chk_chroot(void) {
130} 130}
131 131
132int sandbox(void* sandbox_arg) { 132int sandbox(void* sandbox_arg) {
133 // Get rid of unused parameter warning
134 (void)sandbox_arg;
135
133 pid_t child_pid = getpid(); 136 pid_t child_pid = getpid();
134 if (arg_debug) 137 if (arg_debug)
135 printf("Initializing child process\n"); 138 printf("Initializing child process\n");
diff --git a/src/firejail/seccomp.c b/src/firejail/seccomp.c
index d00a335c6..c1243cd42 100644
--- a/src/firejail/seccomp.c
+++ b/src/firejail/seccomp.c
@@ -337,7 +337,7 @@ static void write_seccomp_file(void) {
337 printf("Save seccomp filter, size %lu bytes\n", sfilter_index * sizeof(struct sock_filter)); 337 printf("Save seccomp filter, size %lu bytes\n", sfilter_index * sizeof(struct sock_filter));
338 errno = 0; 338 errno = 0;
339 ssize_t sz = write(fd, sfilter, sfilter_index * sizeof(struct sock_filter)); 339 ssize_t sz = write(fd, sfilter, sfilter_index * sizeof(struct sock_filter));
340 if (sz != (sfilter_index * sizeof(struct sock_filter))) { 340 if (sz != (ssize_t)(sfilter_index * sizeof(struct sock_filter))) {
341 fprintf(stderr, "Error: cannot save seccomp filter\n"); 341 fprintf(stderr, "Error: cannot save seccomp filter\n");
342 exit(1); 342 exit(1);
343 } 343 }
diff --git a/src/firejail/util.c b/src/firejail/util.c
index 95409129a..29eb101fb 100644
--- a/src/firejail/util.c
+++ b/src/firejail/util.c
@@ -391,7 +391,8 @@ void extract_command_name(const char *str) {
391 391
392 392
393void update_map(char *mapping, char *map_file) { 393void update_map(char *mapping, char *map_file) {
394 int fd, j; 394 int fd;
395 size_t j;
395 size_t map_len; /* Length of 'mapping' */ 396 size_t map_len; /* Length of 'mapping' */
396 397
397 /* Replace commas in mapping string with newlines */ 398 /* Replace commas in mapping string with newlines */
@@ -407,7 +408,7 @@ void update_map(char *mapping, char *map_file) {
407 exit(EXIT_FAILURE); 408 exit(EXIT_FAILURE);
408 } 409 }
409 410
410 if (write(fd, mapping, map_len) != map_len) { 411 if (write(fd, mapping, map_len) != (ssize_t)map_len) {
411 fprintf(stderr, "Error: cannot write to %s: %s\n", map_file, strerror(errno)); 412 fprintf(stderr, "Error: cannot write to %s: %s\n", map_file, strerror(errno));
412 exit(EXIT_FAILURE); 413 exit(EXIT_FAILURE);
413 } 414 }
diff --git a/src/firemon/Makefile.in b/src/firemon/Makefile.in
index 425289695..56c25ee18 100644
--- a/src/firemon/Makefile.in
+++ b/src/firemon/Makefile.in
@@ -8,7 +8,7 @@ H_FILE_LIST = $(wildcard *.[h])
8C_FILE_LIST = $(wildcard *.c) 8C_FILE_LIST = $(wildcard *.c)
9OBJS = $(C_FILE_LIST:.c=.o) 9OBJS = $(C_FILE_LIST:.c=.o)
10BINOBJS = $(foreach file, $(OBJS), $file) 10BINOBJS = $(foreach file, $(OBJS), $file)
11CFLAGS += -ggdb -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security 11CFLAGS += -ggdb -W -Wall -Werror -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
12LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now 12LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now
13 13
14%.o : %.c $(H_FILE_LIST) 14%.o : %.c $(H_FILE_LIST)
diff --git a/src/firemon/firemon.c b/src/firemon/firemon.c
index d77d11a7a..d3c89651e 100644
--- a/src/firemon/firemon.c
+++ b/src/firemon/firemon.c
@@ -40,6 +40,9 @@ static struct termios twait; // no wait on key press
40static int terminal_set = 0; 40static int terminal_set = 0;
41 41
42static void my_handler(int s){ 42static void my_handler(int s){
43 // Remove unused parameter warning
44 (void)s;
45
43 if (terminal_set) 46 if (terminal_set)
44 tcsetattr(0, TCSANOW, &tlocal); 47 tcsetattr(0, TCSANOW, &tlocal);
45 exit(0); 48 exit(0);
diff --git a/src/firemon/netstats.c b/src/firemon/netstats.c
index 6c4a767f1..3f1e00ee9 100644
--- a/src/firemon/netstats.c
+++ b/src/firemon/netstats.c
@@ -195,7 +195,7 @@ void netstats(void) {
195 // start printing 195 // start printing
196 firemon_clrscr(); 196 firemon_clrscr();
197 char *header = get_header(); 197 char *header = get_header();
198 if (strlen(header) > col) 198 if (strlen(header) > (size_t)col)
199 header[col] = '\0'; 199 header[col] = '\0';
200 printf("%s\n", header); 200 printf("%s\n", header);
201 if (row > 0) 201 if (row > 0)
diff --git a/src/firemon/top.c b/src/firemon/top.c
index 1eb753694..8de3ee6b5 100644
--- a/src/firemon/top.c
+++ b/src/firemon/top.c
@@ -42,7 +42,10 @@ static char *get_header(void) {
42// recursivity!!! 42// recursivity!!!
43static char *print_top(unsigned index, unsigned parent, unsigned *utime, unsigned *stime, unsigned itv, float *cpu, int *cnt) { 43static char *print_top(unsigned index, unsigned parent, unsigned *utime, unsigned *stime, unsigned itv, float *cpu, int *cnt) {
44 char *rv = NULL; 44 char *rv = NULL;
45 45
46 // Remove unused parameter warning
47 (void)parent;
48
46 char procdir[20]; 49 char procdir[20];
47 snprintf(procdir, 20, "/proc/%u", index); 50 snprintf(procdir, 20, "/proc/%u", index);
48 struct stat s; 51 struct stat s;
@@ -68,7 +71,7 @@ static char *print_top(unsigned index, unsigned parent, unsigned *utime, unsigne
68 71
69 int i; 72 int i;
70 for (i = index + 1; i < max_pids; i++) { 73 for (i = index + 1; i < max_pids; i++) {
71 if (pids[i].parent == index) 74 if (pids[i].parent == (pid_t)index)
72 print_top(i, index, utime, stime, itv, cpu, cnt); 75 print_top(i, index, utime, stime, itv, cpu, cnt);
73 } 76 }
74 77
@@ -213,7 +216,7 @@ void head_print(int col, int row) {
213 if (current >= row) 216 if (current >= row)
214 break; 217 break;
215 218
216 if (strlen(ptr->line) > col) 219 if (strlen(ptr->line) > (size_t)col)
217 ptr->line[col] = '\0'; 220 ptr->line[col] = '\0';
218 221
219 if (ptr->next == NULL || current == (row - 1)) { 222 if (ptr->next == NULL || current == (row - 1)) {
@@ -264,7 +267,7 @@ void top(void) {
264 // start printing 267 // start printing
265 firemon_clrscr(); 268 firemon_clrscr();
266 char *header = get_header(); 269 char *header = get_header();
267 if (strlen(header) > col) 270 if (strlen(header) > (size_t)col)
268 header[col] = '\0'; 271 header[col] = '\0';
269 printf("%s\n", header); 272 printf("%s\n", header);
270 if (row > 0) 273 if (row > 0)
diff --git a/src/ftee/Makefile.in b/src/ftee/Makefile.in
index 6911f0a3c..8fe4a4c4c 100644
--- a/src/ftee/Makefile.in
+++ b/src/ftee/Makefile.in
@@ -8,7 +8,7 @@ H_FILE_LIST = $(wildcard *.[h])
8C_FILE_LIST = $(wildcard *.c) 8C_FILE_LIST = $(wildcard *.c)
9OBJS = $(C_FILE_LIST:.c=.o) 9OBJS = $(C_FILE_LIST:.c=.o)
10BINOBJS = $(foreach file, $(OBJS), $file) 10BINOBJS = $(foreach file, $(OBJS), $file)
11CFLAGS += -ggdb -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(PREFIX)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security 11CFLAGS += -ggdb -W -Wall -Werror -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(PREFIX)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
12LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread 12LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
13 13
14%.o : %.c $(H_FILE_LIST) 14%.o : %.c $(H_FILE_LIST)
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 6e6be1910..3d9d1d7e2 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -6,7 +6,7 @@ H_FILE_LIST = $(wildcard *.[h])
6C_FILE_LIST = $(wildcard *.c) 6C_FILE_LIST = $(wildcard *.c)
7OBJS = $(C_FILE_LIST:.c=.o) 7OBJS = $(C_FILE_LIST:.c=.o)
8BINOBJS = $(foreach file, $(OBJS), $file) 8BINOBJS = $(foreach file, $(OBJS), $file)
9CFLAGS += -ggdb -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security 9CFLAGS += -ggdb -W -Wall -Werror -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security
10LDFLAGS:=-pic -Wl,-z,relro -Wl,-z,now 10LDFLAGS:=-pic -Wl,-z,relro -Wl,-z,now
11 11
12all: $(OBJS) 12all: $(OBJS)
diff --git a/src/lib/libnetlink.c b/src/lib/libnetlink.c
index 264632a01..40fb099f7 100644
--- a/src/lib/libnetlink.c
+++ b/src/lib/libnetlink.c
@@ -363,7 +363,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
363 fprintf(stderr, "sender address length == %d\n", msg.msg_namelen); 363 fprintf(stderr, "sender address length == %d\n", msg.msg_namelen);
364 exit(1); 364 exit(1);
365 } 365 }
366 for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) { 366 for (h = (struct nlmsghdr*)buf; status >= (int)sizeof(*h); ) {
367 int len = h->nlmsg_len; 367 int len = h->nlmsg_len;
368 int l = len - sizeof(*h); 368 int l = len - sizeof(*h);
369 369
@@ -376,7 +376,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
376 exit(1); 376 exit(1);
377 } 377 }
378 378
379 if (nladdr.nl_pid != peer || 379 if ((pid_t)(nladdr.nl_pid) != peer ||
380 h->nlmsg_pid != rtnl->local.nl_pid || 380 h->nlmsg_pid != rtnl->local.nl_pid ||
381 h->nlmsg_seq != seq) { 381 h->nlmsg_seq != seq) {
382 /* Don't forget to skip that message. */ 382 /* Don't forget to skip that message. */
@@ -387,7 +387,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
387 387
388 if (h->nlmsg_type == NLMSG_ERROR) { 388 if (h->nlmsg_type == NLMSG_ERROR) {
389 struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h); 389 struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
390 if (l < sizeof(struct nlmsgerr)) { 390 if (l < (int)sizeof(struct nlmsgerr)) {
391 fprintf(stderr, "ERROR truncated\n"); 391 fprintf(stderr, "ERROR truncated\n");
392 } else { 392 } else {
393 if (!err->error) { 393 if (!err->error) {
@@ -465,7 +465,7 @@ int rtnl_listen(struct rtnl_handle *rtnl,
465 fprintf(stderr, "Sender address length == %d\n", msg.msg_namelen); 465 fprintf(stderr, "Sender address length == %d\n", msg.msg_namelen);
466 exit(1); 466 exit(1);
467 } 467 }
468 for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) { 468 for (h = (struct nlmsghdr*)buf; status >= (int)sizeof(*h); ) {
469 int err; 469 int err;
470 int len = h->nlmsg_len; 470 int len = h->nlmsg_len;
471 int l = len - sizeof(*h); 471 int l = len - sizeof(*h);
@@ -528,7 +528,7 @@ int rtnl_from_file(FILE *rtnl, rtnl_filter_t handler,
528 len = h->nlmsg_len; 528 len = h->nlmsg_len;
529 l = len - sizeof(*h); 529 l = len - sizeof(*h);
530 530
531 if (l<0 || len>sizeof(buf)) { 531 if (l < 0 || len > (int)sizeof(buf)) {
532 fprintf(stderr, "!!!malformed message: len=%d @%lu\n", 532 fprintf(stderr, "!!!malformed message: len=%d @%lu\n",
533 len, ftell(rtnl)); 533 len, ftell(rtnl));
534 return -1; 534 return -1;
@@ -619,7 +619,7 @@ printf("\tdata length: %d\n", alen);
619 int len = RTA_LENGTH(alen); 619 int len = RTA_LENGTH(alen);
620 struct rtattr *rta; 620 struct rtattr *rta;
621 621
622 if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > maxlen) { 622 if ((int)(NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len)) > maxlen) {
623 fprintf(stderr, "addattr_l ERROR: message exceeded bound of %d\n",maxlen); 623 fprintf(stderr, "addattr_l ERROR: message exceeded bound of %d\n",maxlen);
624 return -1; 624 return -1;
625 } 625 }
@@ -673,7 +673,7 @@ else
673 673
674int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len) 674int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
675{ 675{
676 if (NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) { 676 if ((int)(NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len)) > maxlen) {
677 fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen); 677 fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
678 return -1; 678 return -1;
679 } 679 }
@@ -792,7 +792,7 @@ int parse_rtattr_byindex(struct rtattr *tb[], int max, struct rtattr *rta, int l
792int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta, 792int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta,
793 int len) 793 int len)
794{ 794{
795 if (RTA_PAYLOAD(rta) < len) 795 if ((int)RTA_PAYLOAD(rta) < len)
796 return -1; 796 return -1;
797 if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) { 797 if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) {
798 rta = RTA_DATA(rta) + RTA_ALIGN(len); 798 rta = RTA_DATA(rta) + RTA_ALIGN(len);
diff --git a/src/lib/pid.c b/src/lib/pid.c
index a0261ead2..1a1797ce2 100644
--- a/src/lib/pid.c
+++ b/src/lib/pid.c
@@ -222,15 +222,18 @@ static void print_elem(unsigned index, int nowrap) {
222// recursivity!!! 222// recursivity!!!
223void pid_print_tree(unsigned index, unsigned parent, int nowrap) { 223void pid_print_tree(unsigned index, unsigned parent, int nowrap) {
224 print_elem(index, nowrap); 224 print_elem(index, nowrap);
225
226 // Remove unused parameter warning
227 (void)parent;
225 228
226 int i; 229 unsigned i;
227 for (i = index + 1; i < max_pids; i++) { 230 for (i = index + 1; i < (unsigned)max_pids; i++) {
228 if (pids[i].parent == index) 231 if (pids[i].parent == (pid_t)index)
229 pid_print_tree(i, index, nowrap); 232 pid_print_tree(i, index, nowrap);
230 } 233 }
231 234
232 for (i = 0; i < index; i++) { 235 for (i = 0; i < index; i++) {
233 if (pids[i].parent == index) 236 if (pids[i].parent == (pid_t)index)
234 pid_print_tree(i, index, nowrap); 237 pid_print_tree(i, index, nowrap);
235 } 238 }
236} 239}
@@ -245,6 +248,9 @@ void pid_store_cpu(unsigned index, unsigned parent, unsigned *utime, unsigned *s
245 *utime = 0; 248 *utime = 0;
246 *stime = 0; 249 *stime = 0;
247 } 250 }
251
252 // Remove unused parameter warning
253 (void)parent;
248 254
249 unsigned utmp = 0; 255 unsigned utmp = 0;
250 unsigned stmp = 0; 256 unsigned stmp = 0;
@@ -252,9 +258,9 @@ void pid_store_cpu(unsigned index, unsigned parent, unsigned *utime, unsigned *s
252 *utime += utmp; 258 *utime += utmp;
253 *stime += stmp; 259 *stime += stmp;
254 260
255 int i; 261 unsigned i;
256 for (i = index + 1; i < max_pids; i++) { 262 for (i = index + 1; i < (unsigned)max_pids; i++) {
257 if (pids[i].parent == index) 263 if (pids[i].parent == (pid_t)index)
258 pid_store_cpu(i, index, utime, stime); 264 pid_store_cpu(i, index, utime, stime);
259 } 265 }
260 266
diff --git a/src/libtrace/Makefile.in b/src/libtrace/Makefile.in
index 8848fc08c..ca152cef2 100644
--- a/src/libtrace/Makefile.in
+++ b/src/libtrace/Makefile.in
@@ -6,7 +6,7 @@ H_FILE_LIST = $(wildcard *.[h])
6C_FILE_LIST = $(wildcard *.c) 6C_FILE_LIST = $(wildcard *.c)
7OBJS = $(C_FILE_LIST:.c=.o) 7OBJS = $(C_FILE_LIST:.c=.o)
8BINOBJS = $(foreach file, $(OBJS), $file) 8BINOBJS = $(foreach file, $(OBJS), $file)
9CFLAGS += -ggdb -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security 9CFLAGS += -ggdb -W -Wall -Werror -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security
10LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now 10LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now
11 11
12all: libtrace.so 12all: libtrace.so