Browse Source

*: silence some warnings

warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 12 years ago
parent
commit
549fa53225

+ 9 - 6
libc/sysdeps/linux/alpha/bits/syscalls.h

@@ -27,25 +27,28 @@
 #ifndef __ASSEMBLER__
 
 #define INLINE_SYSCALL_NCS(name, nr, args...)	\
-({						\
+(__extension__					\
+ ({						\
 	long _sc_ret, _sc_err;			\
 	inline_syscall##nr(name, args);		\
-	if (__builtin_expect (_sc_err, 0))	\
+	if (unlikely (_sc_err))			\
 	  {					\
 	    __set_errno (_sc_ret);		\
 	    _sc_ret = -1L;			\
 	  }					\
 	_sc_ret;				\
-})
+  })						\
+)
 
 #define INTERNAL_SYSCALL_NCS(name, err_out, nr, args...) \
-({							\
+(__extension__ \
+ ({							\
 	long _sc_ret, _sc_err;				\
 	inline_syscall##nr(name, args);			\
 	err_out = _sc_err;				\
 	_sc_ret;					\
-})
-
+  }) \
+)
 #define INTERNAL_SYSCALL_DECL(err)		long int err
 #define INTERNAL_SYSCALL_ERROR_P(val, err)	err
 #define INTERNAL_SYSCALL_ERRNO(val, err)	val

+ 18 - 8
libc/sysdeps/linux/arm/bits/syscalls.h

@@ -31,17 +31,22 @@
 #include <errno.h>
 
 #define INLINE_SYSCALL_NCS(name, nr, args...)				\
-  ({ unsigned int _inline_sys_result = INTERNAL_SYSCALL_NCS (name, , nr, args);	\
-     if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_inline_sys_result, ), 0))	\
+(__extension__								\
+  ({									\
+     unsigned int _inline_sys_result = INTERNAL_SYSCALL_NCS (name, , nr, args);\
+     if (unlikely (INTERNAL_SYSCALL_ERROR_P (_inline_sys_result, )))	\
        {								\
-	 __set_errno (INTERNAL_SYSCALL_ERRNO (_inline_sys_result, ));		\
-	 _inline_sys_result = (unsigned int) -1;				\
+	 __set_errno (INTERNAL_SYSCALL_ERRNO (_inline_sys_result, ));	\
+	 _inline_sys_result = (unsigned int) -1;			\
        }								\
-     (int) _inline_sys_result; })
+     (int) _inline_sys_result;						\
+   })									\
+)
 
 #if !defined(__thumb__)
 #if defined(__ARM_EABI__)
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
   ({unsigned int __internal_sys_result;					\
      {									\
        register int __a1 __asm__ ("r0"), _nr __asm__ ("r7");		\
@@ -53,10 +58,12 @@
 			     : "memory");				\
 	       __internal_sys_result = __a1;				\
      }									\
-     (int) __internal_sys_result; })
+     (int) __internal_sys_result; }) \
+)
 #else /* defined(__ARM_EABI__) */
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
   ({ unsigned int __internal_sys_result;				\
      {									\
        register int __a1 __asm__ ("a1");					\
@@ -67,13 +74,15 @@
 		     : "memory");					\
        __internal_sys_result = __a1;					\
      }									\
-     (int) __internal_sys_result; })
+     (int) __internal_sys_result; }) \
+)
 #endif
 #else /* !defined(__thumb__) */
 /* We can't use push/pop inside the asm because that breaks
    unwinding (ie. thread cancellation).
  */
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
   ({ unsigned int __internal_sys_result;				\
     {									\
       int _sys_buf[2];							\
@@ -90,7 +99,8 @@
                     : "memory");					\
 	__internal_sys_result = __a1;					\
     }									\
-    (int) __internal_sys_result; })
+    (int) __internal_sys_result; }) \
+)
 #endif /*!defined(__thumb__)*/
 
 #define INTERNAL_SYSCALL_ERROR_P(val, err) \

+ 3 - 2
libc/sysdeps/linux/avr32/bits/syscalls.h

@@ -9,6 +9,7 @@
 #include <errno.h>
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
 	({								\
 		register int __a1 __asm__("r12");			\
 		register int _scno __asm__("r8") = name;		\
@@ -18,8 +19,8 @@
 			      : "r"(_scno) ASM_ARGS_##nr		\
 			      : "cc", "memory");			\
 		__a1;							\
-	})
-
+	}) \
+)
 #define INTERNAL_SYSCALL_ERROR_P(val, err)		\
 	((unsigned int)(val) >= 0xfffff001U)
 

+ 4 - 3
libc/sysdeps/linux/bfin/bits/syscalls.h

@@ -7,7 +7,8 @@
 #ifndef __ASSEMBLER__
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
-({							\
+(__extension__ \
+ ({							\
 	long __res;					\
 	__asm__ __volatile__ (				\
 		"excpt 0;\n\t"				\
@@ -15,8 +16,8 @@
 		: "qA"  (name) ASMFMT_##nr(args)	\
 		: "memory","CC");			\
 	__res;						\
-})
-
+  }) \
+)
 #define ASMFMT_0()
 
 #define ASMFMT_1(arg1) \

+ 3 - 2
libc/sysdeps/linux/c6x/bits/syscalls.h

@@ -58,6 +58,7 @@
 
 
 #define INTERNAL_SYSCALL_NCS(sys_num, err, nr, args...) \
+(__extension__ \
     ({                                                      \
 	register long __A4 __asm__("A4");		    \
 	register long __b0 __asm__("B0") = sys_num;	    \
@@ -67,8 +68,8 @@
 			     : "b" (__b0) ASM_ARGS_##nr			\
 			     : __SYSCALL_CLOBBERS );			\
 	(int)__A4;							\
-    })
-
+    }) \
+)
 #undef INTERNAL_SYSCALL_ERROR_P
 #define INTERNAL_SYSCALL_ERROR_P(val, err) \
   ((unsigned int) (val) >= 0xfffff001u)

+ 14 - 8
libc/sysdeps/linux/common/bits/syscalls-common.h

@@ -40,21 +40,27 @@
 /* Just like INLINE_SYSCALL(), but take a non-constant syscall (NCS) argument */
 #ifndef INLINE_SYSCALL_NCS
 # define INLINE_SYSCALL_NCS(name, nr, args...)				\
-({									\
+(__extension__								\
+ ({									\
 	INTERNAL_SYSCALL_DECL(__err);					\
-	long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args);	\
-	if (unlikely(INTERNAL_SYSCALL_ERROR_P(__res, __err))) {		\
+	(__extension__							\
+	 ({								\
+	   long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args);	\
+	   if (unlikely(INTERNAL_SYSCALL_ERROR_P(__res, __err))) {	\
 		__set_errno(INTERNAL_SYSCALL_ERRNO(__res, __err));	\
 		__res = -1L;						\
-	}								\
-	__res;								\
-})
+	   }								\
+	   __res;							\
+	  })								\
+	);								\
+  })									\
+)
 #endif
 #ifndef INLINE_SYSCALL_NOERR_NCS
 # define INLINE_SYSCALL_NOERR_NCS(name, nr, args...)			\
 ({									\
-	INTERNAL_SYSCALL_DECL(__err);					\
-	long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args);	\
+	/*INTERNAL_SYSCALL_DECL(__err);*/					\
+	long __res = INTERNAL_SYSCALL_NCS(name, /*__err*/, nr, args);	\
 	__res;								\
 })
 #endif

+ 3 - 2
libc/sysdeps/linux/cris/bits/syscalls.h

@@ -8,6 +8,7 @@
 #ifndef __ASSEMBLER__
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
   ({						\
      register unsigned long __res __asm__ ("r10");	\
      LOAD_ARGS_c_##nr(args)			\
@@ -20,8 +21,8 @@
 		   : ASM_ARGS_##nr (args)	\
 		   : ASM_CLOBBER_##nr);		\
      __res;					\
-   })
-
+   }) \
+)
 #define LOAD_ARGS_c_0()
 #define LOAD_ARGS_asm_0()
 #define ASM_CLOBBER_0 "memory"

+ 7 - 5
libc/sysdeps/linux/hppa/bits/syscalls.h

@@ -38,9 +38,11 @@
    across the syscall. */
 
 #define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
-	        	 "%r20", "%r29", "%r31"
+			 "%r20", "%r29", "%r31"
 
-#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	({	\
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
+ ({	\
 	register unsigned long __res __asm__("r28");		\
 	K_LOAD_ARGS_##nr(args)					\
 	/* FIXME: HACK stw/ldw r19 around syscall */		\
@@ -50,12 +52,12 @@
 		"	ldi %1, %%r20\n"			\
 		K_LDW_ASM_PIC					\
 		: "=r" (__res)					\
-		: "i" (name) K_ASM_ARGS_##nr   			\
+		: "i" (name) K_ASM_ARGS_##nr			\
 		: "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr	\
 	);							\
 	__res;							\
-})
-
+  }) \
+)
 #define K_LOAD_ARGS_0()
 #define K_LOAD_ARGS_1(r26)					\
 	register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);   \

+ 4 - 3
libc/sysdeps/linux/i386/bits/syscalls.h

@@ -15,7 +15,8 @@
 #include <errno.h>
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
-({ \
+(__extension__ \
+ ({ \
 	register unsigned int resultvar; \
 	__asm__ __volatile__ ( \
 		LOADARGS_##nr                                   \
@@ -26,8 +27,8 @@
 		: "g" (name) ASMFMT_##nr(args) : "memory", "cc" \
 	); \
 	(int) resultvar; \
-})
-
+  }) \
+)
 
 #if 1 /* defined __PIC__ || defined __pic__ */
 

+ 8 - 3
libc/sysdeps/linux/ia64/bits/syscalls.h

@@ -62,6 +62,7 @@
     _retval = _r8;
 
 #define INLINE_SYSCALL_NCS(name, nr, args...)		\
+(__extension__						\
   ({							\
     DO_INLINE_SYSCALL_NCS (name, nr, args)		\
     if (unlikely (_r10 == -1))				\
@@ -69,16 +70,20 @@
 	__set_errno (_retval);				\
 	_retval = -1;					\
       }							\
-    _retval; })
+    _retval;						\
+   })							\
+)
 
 #define INTERNAL_SYSCALL_DECL(err) long int err
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
   ({							\
     DO_INLINE_SYSCALL_NCS (name, nr, args)		\
     err = _r10;						\
-    _retval; })
-
+    _retval;						\
+   }) \
+)
 #define INTERNAL_SYSCALL_ERROR_P(val, err)	(err == -1)
 
 #define INTERNAL_SYSCALL_ERRNO(val, err)	(val)

+ 4 - 2
libc/sysdeps/linux/m68k/bits/syscalls.h

@@ -45,6 +45,7 @@
    normally.  It will never touch errno.  This returns just what the kernel
    gave back.  */
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
   ({ unsigned int _sys_result;				\
      {							\
        /* Load argument values in temporary variables
@@ -59,8 +60,9 @@
 		     : "memory");			\
        _sys_result = _d0;				\
      }							\
-     (int) _sys_result; })
-
+     (int) _sys_result;					\
+   }) \
+)
 #define LOAD_ARGS_0()
 #define LOAD_REGS_0
 #define ASM_ARGS_0

+ 3 - 2
libc/sysdeps/linux/microblaze/bits/syscalls.h

@@ -10,6 +10,7 @@
 #include <errno.h>
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
 	({								\
 		register int __ret __asm__("r3");			\
 		register int _scno __asm__("r12") = name;		\
@@ -19,8 +20,8 @@
 			      :  "r"(_scno) ASM_ARGS_##nr		\
 			      : __SYSCALL_CLOBBERS );			\
 		__ret;							\
-	})
-
+	}) \
+)
 #define INTERNAL_SYSCALL_ERROR_P(val, err)		\
 	((unsigned int)(val) >= 0xfffff001U)
 

+ 3 - 1
libc/sysdeps/linux/nios2/bits/syscalls.h

@@ -19,6 +19,7 @@
 	} while (0)
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
 	({								\
 		long __res;						\
 		__asm__ __volatile__ (					\
@@ -36,7 +37,8 @@
 			  CLOB_ARGS_##nr          /* Clobbered       */ \
 		);							\
 		__res;							\
-	})
+	}) \
+)
 
 #define INTERNAL_SYSCALL_ERROR_P(val, err)	\
 	((unsigned long)(val) >= (unsigned long)(-125))

+ 3 - 2
libc/sysdeps/linux/powerpc/bits/syscalls.h

@@ -141,6 +141,7 @@
 # define INTERNAL_SYSCALL_DECL(err) long int err
 
 # define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
   ({									\
     register long int r0  __asm__ ("r0");				\
     register long int r3  __asm__ ("r3");				\
@@ -164,8 +165,8 @@
        : "cr0", "ctr", "memory");					\
     err = r0;								\
     (int) r3;								\
-  })
-
+  }) \
+)
 # define INTERNAL_SYSCALL_ERROR_P(val, err) \
   ((void) (val), __builtin_expect ((err) & (1 << 28), 0))
 

+ 13 - 12
libc/sysdeps/linux/sh/bits/syscalls.h

@@ -114,18 +114,19 @@
 
 /* The _NCS variant allows non-constant syscall numbers.  */
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
-  ({									      \
-    unsigned long int resultvar;					      \
-    register long int r3 __asm__ ("%r3") = (name);			 	      \
-    SUBSTITUTE_ARGS_##nr(args);						      \
-									      \
-    __asm__ __volatile__ (SYSCALL_INST_STR##nr SYSCALL_INST_PAD			      \
-		  : "=z" (resultvar)					      \
-		  : "r" (r3) ASMFMT_##nr				      \
-		  : "memory");						      \
-									      \
-    (int) resultvar; })
-
+(__extension__ \
+  ({															\
+    unsigned long int resultvar;								\
+    register long int r3 __asm__ ("%r3") = (name);				\
+    SUBSTITUTE_ARGS_##nr(args);									\
+    __asm__ __volatile__ (SYSCALL_INST_STR##nr SYSCALL_INST_PAD	\
+		  : "=z" (resultvar)									\
+		  : "r" (r3) ASMFMT_##nr								\
+		  : "memory"											\
+    );															\
+    (int) resultvar;											\
+   }) \
+)
 #define INTERNAL_SYSCALL_ERROR_P(val, err) \
   ((unsigned int) (val) >= 0xfffff001u)
 

+ 3 - 2
libc/sysdeps/linux/sparc/bits/syscalls.h

@@ -36,6 +36,7 @@
 #endif
 
 #define INTERNAL_SYSCALL_NCS(sys_num, err, nr, args...) \
+(__extension__ \
     ({                                                      \
         unsigned int __res;                                 \
         {                                                   \
@@ -48,8 +49,8 @@
                 : __SYSCALL_CLOBBERS );                                   \
         }                                                   \
         (int)__res;                                         \
-     })
-
+     }) \
+)
 #define INTERNAL_SYSCALL_ERROR_P(val, err) \
   ((unsigned int) (val) >= 0xfffff001u)
 

+ 5 - 3
libc/sysdeps/linux/x86_64/bits/syscalls.h

@@ -67,16 +67,18 @@
 /* Define a macro which expands inline into the wrapper code for a system
    call.  */
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
   ({									      \
     unsigned long resultvar;						      \
     LOAD_ARGS_##nr (args)						      \
     LOAD_REGS_##nr							      \
-    __asm__ __volatile__ (							      \
+    __asm__ __volatile__ (						      \
     "syscall\n\t"							      \
     : "=a" (resultvar)							      \
     : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");		      \
-    (long) resultvar; })
-
+    (long) resultvar;							      \
+   }) \
+)
 #define LOAD_ARGS_0()
 #define LOAD_REGS_0
 #define ASM_ARGS_0

+ 4 - 2
libc/sysdeps/linux/xtensa/bits/syscalls.h

@@ -73,13 +73,15 @@
    call.  */
 
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			      \
+(__extension__ \
   ({ LD_ARG(2, name);							      \
      LD_ARGS_##nr(args);						      \
      __asm__ __volatile__ ("syscall\n" 						      \
 	 	   : "=a" (_a2)						      \
 	 	   : ASM_ARGS_##nr					      \
 	 	   : "memory");						      \
-     (long) _a2; })
-
+     (long) _a2;							      \
+   }) \
+)
 #endif /* not __ASSEMBLER__ */
 #endif /* _BITS_SYSCALLS_H */