public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: libc-ports@sourceware.org
Subject: [PATCH] ia64: fix set-but-unused warnings with syscalls
Date: Mon, 11 Mar 2013 03:02:00 -0000	[thread overview]
Message-ID: <1362971082-22765-1-git-send-email-vapier@gentoo.org> (raw)

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/sysdeps/unix/sysv/linux/ia64/sysdep.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h
index c6fce13..96f6a4e 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -252,7 +252,7 @@
     _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...)	\
@@ -264,7 +264,10 @@
   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)
-- 
1.8.1.2

                 reply	other threads:[~2013-03-11  3:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362971082-22765-1-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).