]> sourceware.org Git - glibc.git/commitdiff
ia64: fix set-but-unused warnings with syscalls
authorMike Frysinger <vapier@gentoo.org>
Mon, 11 Mar 2013 01:22:12 +0000 (01:22 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 12 Mar 2013 10:01:38 +0000 (06:01 -0400)
These macros often set up a variable that later macros sometimes do
not use.  Add unused attribute to avoid that.

Similarly, the ia64 code tends to check the err field rather than
the val (which is opposite of most arches) leading to the same
kind of warning.  Replace this with a dummy reference.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
ports/ChangeLog.ia64
ports/sysdeps/unix/sysv/linux/ia64/sysdep.h

index 371be42e46949c2900a47279b12fc07ae2529477..50b5604ec181ea27756f67d80ff3456cfc1cddc2 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sysdeps/unix/sysv/linux/ia64/sysdep.h (INTERNAL_SYSCALL_DECL): Add
+       __attribute__ ((unused)) to err decl.
+       (INTERNAL_SYSCALL_ERROR_P): Add (void)val dummy reference.
+
 2013-03-12  Mike Frysinger  <vapier@gentoo.org>
 
        * sysdeps/ia64/fpu/libm_error.c (STATIC): Delete redundant definition.
index c6fce1313e7205ee8c9a4408a228dc344975caa6..96f6a4e8a5cb6a2ccd830e8a044d404f7621afc6 100644 (file)
     _retval; })
 
 #undef INTERNAL_SYSCALL_DECL
-#define INTERNAL_SYSCALL_DECL(err) long int err
+#define INTERNAL_SYSCALL_DECL(err) long int err __attribute__ ((unused))
 
 #undef INTERNAL_SYSCALL
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)   \
   INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
 
 #undef INTERNAL_SYSCALL_ERROR_P
-#define INTERNAL_SYSCALL_ERROR_P(val, err)     (err == -1)
+#define INTERNAL_SYSCALL_ERROR_P(val, err)             \
+  ({ (void) (val);                                     \
+     (err == -1);                                      \
+  })
 
 #undef INTERNAL_SYSCALL_ERRNO
 #define INTERNAL_SYSCALL_ERRNO(val, err)       (val)
This page took 0.05617 seconds and 5 git commands to generate.