From c632f0d067aa79ffdbc67d32e62fb1bc44be589b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 16 Feb 2014 11:34:22 +0100 Subject: [PATCH] Add -Wextra -Werror to all C code --- misc/Makefile | 2 +- qrexec/Makefile | 2 +- qrexec/qrexec-agent.c | 10 +++++----- qubes-rpc/Makefile | 2 +- qubes-rpc/qfile-unpacker.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/misc/Makefile b/misc/Makefile index 8b6ad61..418c0fb 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,5 +1,5 @@ CC=gcc -CFLAGS=-Wall -g -O3 +CFLAGS=-Wall -Wextra -Werror -g -O3 all: xenstore-watch python xenstore-watch: xenstore-watch.o $(CC) -o xenstore-watch xenstore-watch.o -lxenstore diff --git a/qrexec/Makefile b/qrexec/Makefile index f0040f2..49f1857 100644 --- a/qrexec/Makefile +++ b/qrexec/Makefile @@ -1,5 +1,5 @@ CC=gcc -CFLAGS+=-I. -g -Wall -pie -fPIC +CFLAGS+=-I. -g -Wall -Wextra -Werror -pie -fPIC XENLIBS=-lvchan -lxenstore -lxenctrl LIBS=$(XENLIBS) -lqrexec-utils diff --git a/qrexec/qrexec-agent.c b/qrexec/qrexec-agent.c index 164dd0b..7ca91e1 100644 --- a/qrexec/qrexec-agent.c +++ b/qrexec/qrexec-agent.c @@ -149,7 +149,7 @@ void do_exec(const char *cmd) exit(1); } -void handle_just_exec(int client_id, int len) +void handle_just_exec(int len) { char buf[len]; int fdn, pid; @@ -362,7 +362,7 @@ void handle_server_data() break; case MSG_SERVER_TO_AGENT_JUST_EXEC: wake_meminfo_writer(); - handle_just_exec(s_hdr.client_id, s_hdr.len); + handle_just_exec(s_hdr.len); break; case MSG_SERVER_TO_AGENT_INPUT: handle_input(s_hdr.client_id, s_hdr.len); @@ -385,7 +385,7 @@ void handle_process_data(int fd) int len; len = buffer_space_vchan_ext(); - if (len <= sizeof s_hdr) + if (len <= (int)sizeof s_hdr) return; ret = read(fd, buf, len - sizeof s_hdr); @@ -425,7 +425,7 @@ void handle_process_data(int fd) volatile int child_exited; -void sigchld_handler(int x) +void sigchld_handler(int x __attribute__((__unused__))) { child_exited = 1; signal(SIGCHLD, sigchld_handler); @@ -580,7 +580,7 @@ int main() reap_children(); max = fill_fds_for_select(&rdset, &wrset); if (buffer_space_vchan_ext() <= - sizeof(struct server_header)) + (int)sizeof(struct server_header)) FD_ZERO(&rdset); wait_for_vchan_or_argfd(max, &rdset, &wrset); diff --git a/qubes-rpc/Makefile b/qubes-rpc/Makefile index cb49648..3a056b3 100644 --- a/qubes-rpc/Makefile +++ b/qubes-rpc/Makefile @@ -1,5 +1,5 @@ CC=gcc -CFLAGS=-g -Wall -I. -fPIC -pie +CFLAGS=-g -Wall -Wextra -Werror -I. -fPIC -pie all: vm-file-editor qopen-in-vm qfile-agent qfile-unpacker tar2qfile vm-file-editor: vm-file-editor.o $(CC) -pie -g -o $@ $^ -lqubes-rpc-filecopy diff --git a/qubes-rpc/qfile-unpacker.c b/qubes-rpc/qfile-unpacker.c index 61dee40..7bb8606 100644 --- a/qubes-rpc/qfile-unpacker.c +++ b/qubes-rpc/qfile-unpacker.c @@ -31,7 +31,7 @@ int prepare_creds_return_uid(const char *username) return pwd->pw_uid; } -int main(int argc, char ** argv) +int main(int argc __attribute((__unused__)), char ** argv __attribute__((__unused__))) { char *incoming_dir; int uid;