From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWVYE-0003vV-Dv for qemu-devel@nongnu.org; Fri, 22 Aug 2008 08:15:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWVYB-0003uj-QU for qemu-devel@nongnu.org; Fri, 22 Aug 2008 08:15:32 -0400 Received: from [199.232.76.173] (port=35014 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWVYB-0003ue-9j for qemu-devel@nongnu.org; Fri, 22 Aug 2008 08:15:31 -0400 Received: from gecko.sbs.de ([194.138.37.40]:16753) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWVYA-00040R-OF for qemu-devel@nongnu.org; Fri, 22 Aug 2008 08:15:31 -0400 Received: from mail1.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m7MCFSkE015347 for ; Fri, 22 Aug 2008 14:15:29 +0200 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m7MCFS3j011147 for ; Fri, 22 Aug 2008 14:15:28 +0200 Message-ID: <48AEADE1.10204@siemens.com> Date: Fri, 22 Aug 2008 14:15:29 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [5022] Fix some warnings that would be generated by gcc -Wmissing-prototypes Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Blue Swirl wrote: > Revision: 5022 > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5022 > Author: blueswir1 > Date: 2008-08-17 20:26:25 +0000 (Sun, 17 Aug 2008) > > Log Message: > ----------- > Fix some warnings that would be generated by gcc -Wmissing-prototypes > ... > Modified: trunk/linux-user/syscall.c > =================================================================== > --- trunk/linux-user/syscall.c 2008-08-17 20:21:51 UTC (rev 5021) > +++ trunk/linux-user/syscall.c 2008-08-17 20:26:25 UTC (rev 5022) > @@ -105,38 +105,38 @@ > #undef _syscall6 > > #define _syscall0(type,name) \ > -type name (void) \ > +static type name (void) \ > { \ > return syscall(__NR_##name); \ > } > > #define _syscall1(type,name,type1,arg1) \ > -type name (type1 arg1) \ > +static type name (type1 arg1) \ > { \ > return syscall(__NR_##name, arg1); \ > } > > #define _syscall2(type,name,type1,arg1,type2,arg2) \ > -type name (type1 arg1,type2 arg2) \ > +static type name (type1 arg1,type2 arg2) \ > { \ > return syscall(__NR_##name, arg1, arg2); \ > } > > #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ > -type name (type1 arg1,type2 arg2,type3 arg3) \ > +static type name (type1 arg1,type2 arg2,type3 arg3) \ > { \ > return syscall(__NR_##name, arg1, arg2, arg3); \ > } > > #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ > -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \ > +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \ > { \ > return syscall(__NR_##name, arg1, arg2, arg3, arg4); \ > } > > #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ > type5,arg5) \ > -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ > +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ > { \ > return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5); \ > } > @@ -144,7 +144,8 @@ > > #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ > type5,arg5,type6,arg6) \ > -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ > +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ > + type6 arg6) \ > { \ > return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5, arg6); \ > } > @@ -204,8 +205,10 @@ > _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count); > #endif > _syscall2(int, sys_getpriority, int, which, int, who); > +#if !defined (__x86_64__) > _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, > loff_t *, res, uint, wh); > +#endif > #if defined(TARGET_NR_linkat) && defined(__NR_linkat) > _syscall5(int,sys_linkat,int,olddirfd,const char *,oldpath, > int,newdirfd,const char *,newpath,int,flags) > @@ -253,11 +256,12 @@ > _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, > const struct timespec *,tsp,int,flags) > #endif > +#if defined(USE_NPTL) > #if defined(TARGET_NR_futex) && defined(__NR_futex) > _syscall6(int,sys_futex,int *,uaddr,int,op,int,val, > const struct timespec *,timeout,int *,uaddr2,int,val3) > - > #endif > +#endif > > extern int personality(int); > extern int flock(int, int); > @@ -2522,8 +2526,8 @@ > } > > /* specific and weird i386 syscalls */ > -abi_long do_modify_ldt(CPUX86State *env, int func, abi_ulong ptr, > - unsigned long bytecount) > +static abi_long do_modify_ldt(CPUX86State *env, int func, abi_ulong ptr, > + unsigned long bytecount) > { > abi_long ret; > > @@ -2544,7 +2548,7 @@ > return ret; > } > > -abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr) > +static abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr) > { > uint64_t *gdt_table = g2h(env->gdt.base); > struct target_modify_ldt_ldt_s ldt_info; > @@ -2629,7 +2633,7 @@ > return 0; > } > > -abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) > +static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) > { > struct target_modify_ldt_ldt_s *target_ldt_info; > uint64_t *gdt_table = g2h(env->gdt.base); > @@ -2677,7 +2681,7 @@ > } > > #ifndef TARGET_ABI32 > -abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) > +static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) > { > abi_long ret; > abi_ulong val; > @@ -3150,8 +3154,8 @@ > futexes locally would make futexes shared between multiple processes > tricky. However they're probably useless because guest atomic > operations won't work either. */ > -int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, > - target_ulong uaddr2, int val3) > +static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, > + target_ulong uaddr2, int val3) > { > struct timespec ts, *pts; > > To make syscall.c for 64 bit truly warning-free, we need some more #ifs. Signed-off-by: Jan Kiszka --- linux-user/syscall.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: b/linux-user/syscall.c =================================================================== --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -195,12 +195,14 @@ _syscall4(int,sys_faccessat,int,dirfd,co _syscall4(int,sys_fchmodat,int,dirfd,const char *,pathname, mode_t,mode,int,flags) #endif -#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) +#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16) _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname, uid_t,owner,gid_t,group,int,flags) #endif _syscall2(int,sys_getcwd1,char *,buf,size_t,size) +#if TARGET_ABI_BITS == 32 _syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count); +#endif #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64) _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count); #endif @@ -2548,6 +2550,7 @@ static abi_long do_modify_ldt(CPUX86Stat return ret; } +#if defined(TARGET_I386) && defined(TARGET_ABI32) static abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr) { uint64_t *gdt_table = g2h(env->gdt.base); @@ -2679,6 +2682,7 @@ static abi_long do_get_thread_area(CPUX8 unlock_user_struct(target_ldt_info, ptr, 1); return 0; } +#endif /* TARGET_I386 && TARGET_ABI32 */ #ifndef TARGET_ABI32 static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)