Add -Wextra -Werror to all C code

This commit is contained in:
Marek Marczykowski-Górecki 2014-02-16 11:34:22 +01:00
parent d931ba237e
commit c632f0d067
5 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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;