Browse Source

Add -Wextra -Werror to all C code

Marek Marczykowski-Górecki 10 years ago
parent
commit
c632f0d067
5 changed files with 9 additions and 9 deletions
  1. 1 1
      misc/Makefile
  2. 1 1
      qrexec/Makefile
  3. 5 5
      qrexec/qrexec-agent.c
  4. 1 1
      qubes-rpc/Makefile
  5. 1 1
      qubes-rpc/qfile-unpacker.c

+ 1 - 1
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

+ 1 - 1
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
 

+ 5 - 5
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);

+ 1 - 1
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

+ 1 - 1
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;