From: Jeff Dike This is a bunch of compile fixes provoked by building UML with gcc 4. There are a bunch of signedness mismatches, a couple of uninitialized references, and a botched C99 structure initialization which had somehow gone unnoticed. Signed-off-by: Jeff Dike Signed-off-by: Andrew Morton --- arch/um/drivers/chan_user.c | 4 ++-- arch/um/drivers/net_user.c | 2 +- arch/um/drivers/slip.h | 4 ++-- arch/um/drivers/slip_proto.h | 3 ++- arch/um/drivers/slirp.h | 4 ++-- arch/um/drivers/stderr_console.c | 6 +++--- arch/um/include/mconsole.h | 2 +- arch/um/include/net_user.h | 2 +- arch/um/include/os.h | 2 +- arch/um/include/user_util.h | 3 --- arch/um/os-Linux/elf_aux.c | 6 +++++- arch/um/os-Linux/file.c | 2 +- 12 files changed, 21 insertions(+), 19 deletions(-) diff -puN arch/um/drivers/chan_user.c~uml-compile-fixes-for-gcc-4 arch/um/drivers/chan_user.c --- 25/arch/um/drivers/chan_user.c~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/drivers/chan_user.c Mon Jun 6 15:36:48 2005 @@ -168,7 +168,7 @@ static int winch_tramp(int fd, struct tt printk("winch_tramp : failed to read synchronization byte\n"); printk("read failed, err = %d\n", -n); printk("fd %d will not support SIGWINCH\n", fd); - *fd_out = -1; + pid = -1; } return(pid); } @@ -186,7 +186,7 @@ void register_winch(int fd, struct tty_s if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, tty) && (pid == -1)){ thread = winch_tramp(fd, tty, &thread_fd); - if(fd != -1){ + if(thread > 0){ register_winch_irq(thread_fd, fd, thread, tty); count = os_write_file(thread_fd, &c, sizeof(c)); diff -puN arch/um/drivers/net_user.c~uml-compile-fixes-for-gcc-4 arch/um/drivers/net_user.c --- 25/arch/um/drivers/net_user.c~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/drivers/net_user.c Mon Jun 6 15:36:48 2005 @@ -32,7 +32,7 @@ int tap_open_common(void *dev, char *gat return(0); } -void tap_check_ips(char *gate_addr, char *eth_addr) +void tap_check_ips(char *gate_addr, unsigned char *eth_addr) { int tap_addr[4]; diff -puN arch/um/drivers/slip.h~uml-compile-fixes-for-gcc-4 arch/um/drivers/slip.h --- 25/arch/um/drivers/slip.h~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/drivers/slip.h Mon Jun 6 15:36:49 2005 @@ -12,8 +12,8 @@ struct slip_data { char *addr; char *gate_addr; int slave; - char ibuf[ENC_BUF_SIZE]; - char obuf[ENC_BUF_SIZE]; + unsigned char ibuf[ENC_BUF_SIZE]; + unsigned char obuf[ENC_BUF_SIZE]; int more; /* more data: do not read fd until ibuf has been drained */ int pos; int esc; diff -puN arch/um/drivers/slip_proto.h~uml-compile-fixes-for-gcc-4 arch/um/drivers/slip_proto.h --- 25/arch/um/drivers/slip_proto.h~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/drivers/slip_proto.h Mon Jun 6 15:36:49 2005 @@ -12,7 +12,8 @@ #define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */ #define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */ -static inline int slip_unesc(unsigned char c,char *buf,int *pos, int *esc) +static inline int slip_unesc(unsigned char c, unsigned char *buf, int *pos, + int *esc) { int ret; diff -puN arch/um/drivers/slirp.h~uml-compile-fixes-for-gcc-4 arch/um/drivers/slirp.h --- 25/arch/um/drivers/slirp.h~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/drivers/slirp.h Mon Jun 6 15:36:49 2005 @@ -24,8 +24,8 @@ struct slirp_data { struct arg_list_dummy_wrapper argw; int pid; int slave; - char ibuf[ENC_BUF_SIZE]; - char obuf[ENC_BUF_SIZE]; + unsigned char ibuf[ENC_BUF_SIZE]; + unsigned char obuf[ENC_BUF_SIZE]; int more; /* more data: do not read fd until ibuf has been drained */ int pos; int esc; diff -puN arch/um/drivers/stderr_console.c~uml-compile-fixes-for-gcc-4 arch/um/drivers/stderr_console.c --- 25/arch/um/drivers/stderr_console.c~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/drivers/stderr_console.c Mon Jun 6 15:36:49 2005 @@ -22,9 +22,9 @@ static void stderr_console_write(struct } static struct console stderr_console = { - .name "stderr", - .write stderr_console_write, - .flags CON_PRINTBUFFER, + .name = "stderr", + .write = stderr_console_write, + .flags = CON_PRINTBUFFER, }; static int __init stderr_console_init(void) diff -puN arch/um/include/mconsole.h~uml-compile-fixes-for-gcc-4 arch/um/include/mconsole.h --- 25/arch/um/include/mconsole.h~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/include/mconsole.h Mon Jun 6 15:36:49 2005 @@ -56,7 +56,7 @@ struct mc_request int as_interrupt; int originating_fd; - int originlen; + unsigned int originlen; unsigned char origin[128]; /* sockaddr_un */ struct mconsole_request request; diff -puN arch/um/include/net_user.h~uml-compile-fixes-for-gcc-4 arch/um/include/net_user.h --- 25/arch/um/include/net_user.h~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/include/net_user.h Mon Jun 6 15:36:49 2005 @@ -35,7 +35,7 @@ extern void *get_output_buffer(int *len_ extern void free_output_buffer(void *buffer); extern int tap_open_common(void *dev, char *gate_addr); -extern void tap_check_ips(char *gate_addr, char *eth_addr); +extern void tap_check_ips(char *gate_addr, unsigned char *eth_addr); extern void read_output(int fd, char *output_out, int len); diff -puN arch/um/include/os.h~uml-compile-fixes-for-gcc-4 arch/um/include/os.h --- 25/arch/um/include/os.h~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/include/os.h Mon Jun 6 15:36:49 2005 @@ -136,7 +136,7 @@ extern int os_seek_file(int fd, __u64 of extern int os_open_file(char *file, struct openflags flags, int mode); extern int os_read_file(int fd, void *buf, int len); extern int os_write_file(int fd, const void *buf, int count); -extern int os_file_size(char *file, long long *size_out); +extern int os_file_size(char *file, unsigned long long *size_out); extern int os_file_modtime(char *file, unsigned long *modtime); extern int os_pipe(int *fd, int stream, int close_on_exec); extern int os_set_fd_async(int fd, int owner); diff -puN arch/um/include/user_util.h~uml-compile-fixes-for-gcc-4 arch/um/include/user_util.h --- 25/arch/um/include/user_util.h~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/include/user_util.h Mon Jun 6 15:36:49 2005 @@ -41,9 +41,6 @@ extern unsigned long highmem; extern char host_info[]; extern char saved_command_line[]; -extern char command_line[]; - -extern char *tempdir; extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; extern unsigned long _unprotected_end; diff -puN arch/um/os-Linux/elf_aux.c~uml-compile-fixes-for-gcc-4 arch/um/os-Linux/elf_aux.c --- 25/arch/um/os-Linux/elf_aux.c~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/os-Linux/elf_aux.c Mon Jun 6 15:36:49 2005 @@ -45,7 +45,11 @@ __init void scan_elf_aux( char **envp) elf_aux_hwcap = auxv->a_un.a_val; break; case AT_PLATFORM: - elf_aux_platform = auxv->a_un.a_ptr; + /* elf.h removed the pointer elements from + * a_un, so we have to use a_val, which is + * all that's left. + */ + elf_aux_platform = (char *) auxv->a_un.a_val; break; case AT_PAGESZ: page_size = auxv->a_un.a_val; diff -puN arch/um/os-Linux/file.c~uml-compile-fixes-for-gcc-4 arch/um/os-Linux/file.c --- 25/arch/um/os-Linux/file.c~uml-compile-fixes-for-gcc-4 Mon Jun 6 15:36:48 2005 +++ 25-akpm/arch/um/os-Linux/file.c Mon Jun 6 15:36:49 2005 @@ -363,7 +363,7 @@ int os_write_file(int fd, const void *bu (int (*)(int, void *, int)) write, copy_to_user_proc)); } -int os_file_size(char *file, long long *size_out) +int os_file_size(char *file, unsigned long long *size_out) { struct uml_stat buf; int err; _