diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-03-20 11:57:49 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-03-20 11:57:49 -0400 |
commit | c884cc46193c98fd0b90ce8a79c081f6a1c18cc6 (patch) | |
tree | 4881f686ec5c7cd8f44ead22588fee7cc59f78c1 /gdb/nat | |
parent | 1ff700c202465275d1ca3aee4dd979db36274294 (diff) | |
download | gdb-c884cc46193c98fd0b90ce8a79c081f6a1c18cc6.zip gdb-c884cc46193c98fd0b90ce8a79c081f6a1c18cc6.tar.gz gdb-c884cc46193c98fd0b90ce8a79c081f6a1c18cc6.tar.bz2 |
gdb: remove HAVE_DECL_PTRACE
I stumbled on this snippet in nat/gdb_ptrace.h:
/* Some systems, in particular DEC OSF/1, Digital Unix, Compaq Tru64
or whatever it's called these days, don't provide a prototype for
ptrace. Provide one to silence compiler warnings. */
#ifndef HAVE_DECL_PTRACE
extern PTRACE_TYPE_RET ptrace();
#endif
I believe this is unnecessary today and should be removed. First, the
comment only mentions OSes we don't support (and to be honest, I had
never even heard of).
But most importantly, in C++, a declaration with empty parenthesis
declares a function that accepts no arguments, unlike in C. So if this
declaration was really used, GDB wouldn't build, since all ptrace call
sites pass some arguments. Since we haven't heard anything about this
causing some build failures since we have transitioned to C++, I
conclude that it's not used.
This patch removes it as well as the corresponding configure check.
gdb/ChangeLog:
* ptrace.m4: Don't check for ptrace declaration.
* config.in: Re-generate.
* configure: Re-generate.
* nat/gdb_ptrace.h: Don't declare ptrace if HAVE_DECL_PTRACE is
not defined.
gdbserver/ChangeLog:
* config.in: Re-generate.
* configure: Re-generate.
gdbsupport/ChangeLog:
* config.in: Re-generate.
* configure: Re-generate.
Diffstat (limited to 'gdb/nat')
-rw-r--r-- | gdb/nat/gdb_ptrace.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/gdb/nat/gdb_ptrace.h b/gdb/nat/gdb_ptrace.h index 9c2587f..1278246 100644 --- a/gdb/nat/gdb_ptrace.h +++ b/gdb/nat/gdb_ptrace.h @@ -121,14 +121,6 @@ # endif #endif -/* Some systems, in particular DEC OSF/1, Digital Unix, Compaq Tru64 - or whatever it's called these days, don't provide a prototype for - ptrace. Provide one to silence compiler warnings. */ - -#ifndef HAVE_DECL_PTRACE -extern PTRACE_TYPE_RET ptrace(); -#endif - /* Some systems, at least AIX and HP-UX have a ptrace with five arguments. Since we never use the fifth argument, define a ptrace macro that calls the real ptrace with the last argument set to |