public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] darwin: Silence syscall deprecated declaration warning
@ 2018-07-04  4:31 Simon Marchi
  2018-07-04  4:31 ` [PATCH 2/2] darwin: Don't use sbrk Simon Marchi
  2018-07-04 10:31 ` [PATCH 1/2] darwin: Silence syscall deprecated declaration warning Pedro Alves
  0 siblings, 2 replies; 7+ messages in thread
From: Simon Marchi @ 2018-07-04  4:31 UTC (permalink / raw)
  To: gdb-patches; +Cc: tom, Simon Marchi

This patch silences this warning:

/Users/simark/src/binutils-gdb/gdb/darwin-nat.c:839:10: error: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations]
          res = syscall (SYS___pthread_kill, thread->gdb_port, nsignal);
                ^
/usr/include/unistd.h:745:6: note: 'syscall' has been explicitly marked deprecated here
int      syscall(int, ...);
         ^

I guess it would be good to find a non-deprecated alternative for
sending that signal to a specific thread, but I have not idea what we
could use instead (not sure if plain kill would do the trick).

gdb/ChangeLog:

	* darwin-nat.c (darwin_resume_thread): Silence syscall
	deprecated declaration warning.
---
 gdb/darwin-nat.c      | 3 +++
 include/diagnostics.h | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 8104de53e7f8..95b89aaae302 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -836,7 +836,10 @@ darwin_resume_thread (struct inferior *inf, darwin_thread_t *thread,
 	{
 	  /* Note: ptrace is allowed only if the process is stopped.
 	     Directly send the signal to the thread.  */
+	  DIAGNOSTIC_PUSH;
+	  DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS;
 	  res = syscall (SYS___pthread_kill, thread->gdb_port, nsignal);
+	  DIAGNOSTIC_POP;
 	  inferior_debug (4, _("darwin_resume_thread: kill 0x%x %d: %d\n"),
 			  thread->gdb_port, nsignal, res);
 	  thread->signaled = 1;
diff --git a/include/diagnostics.h b/include/diagnostics.h
index 4a674106dc01..34fc01b85bd4 100644
--- a/include/diagnostics.h
+++ b/include/diagnostics.h
@@ -35,6 +35,8 @@
 #if defined (__clang__) /* clang */
 
 # define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
+# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \
+  DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations")
 # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \
   DIAGNOSTIC_IGNORE ("-Wdeprecated-register")
 # define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
@@ -56,6 +58,10 @@
 # define DIAGNOSTIC_IGNORE_SELF_MOVE
 #endif
 
+#ifndef DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
+# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
+#endif
+
 #ifndef DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
 # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
 #endif
-- 
2.17.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-05 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04  4:31 [PATCH 1/2] darwin: Silence syscall deprecated declaration warning Simon Marchi
2018-07-04  4:31 ` [PATCH 2/2] darwin: Don't use sbrk Simon Marchi
2018-07-04 10:49   ` Pedro Alves
2018-07-04 16:41     ` Simon Marchi
2018-07-04 10:31 ` [PATCH 1/2] darwin: Silence syscall deprecated declaration warning Pedro Alves
2018-07-04 16:39   ` Simon Marchi
2018-07-05 16:12     ` Pedro Alves

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).