commit 549fa53225910f5341092d6647a1e3dd705b605f broke INLINE_SYSCALL_NOERR_NCS

Khem Raj raj.khem at gmail.com
Fri Feb 3 18:55:56 UTC 2012


This commit below broke ppc and mips for me
since they assign to err specifically in
INTERNAL_SYSCALL_NCS definitions so now

commit 549fa53225910f5341092d6647a1e3dd705b605f
Author: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
Date:   Thu Jan 26 15:15:23 2012 +0100

    *: silence some warnings

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

    Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>


this is the hunk I am talking about __err declaration has been
commented out. Do you know Bernhard why ?
now any functions using _syscall_noerr0 and _syscall_noerr1 wont compile anymore
if this was just meant as a cleanup then please reinsert it since we
really need it.

diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h
b/libc/sysdeps/linux/common/bits/syscalls-common.h
index 1b84d9e..faebd1b 100644
--- a/libc/sysdeps/linux/common/bits/syscalls-common.h
+++ b/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


More information about the uClibc mailing list