* [PATCH] readline: rltty.c: Declare ioctl() explicitly.
@ 2015-04-19 14:25 Chen Gang
2015-04-19 16:46 ` Mike Frysinger
0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2015-04-19 14:25 UTC (permalink / raw)
To: binutils, gdb-patches
Under Darwin, ioctl() is declared in "sys/ioctl.h", but except for some
special control commands, we do not want to include "sys/ioctl.h". So
declare it explicitly, the related warning:
gcc -c -DHAVE_CONFIG_H -I. -I../../binutils-gdb/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 ../../binutils-gdb/readline/rltty.c
../../binutils-gdb/readline/rltty.c: In function 'set_winsize':
../../binutils-gdb/readline/rltty.c:83:7: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration]
if (ioctl (tty, TIOCGWINSZ, &w) == 0)
^
2015-04-19 Chen Gang <gang.chen.5i5j@gmail.com>
* rltty.c: Declare ioctl() explicitly.
---
readline/ChangeLog.gdb | 4 ++++
readline/rltty.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb
index a1051aa..dac2a2b 100644
--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,5 +1,9 @@
2015-04-19 Chen Gang <gang.chen.5i5j@gmail.com>
+ * rltty.c: Declare ioctl() explicitly.
+
+2015-04-19 Chen Gang <gang.chen.5i5j@gmail.com>
+
* rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled.
2014-12-30 Eli Zaretskii <eliz@gnu.org>
diff --git a/readline/rltty.c b/readline/rltty.c
index d237b1c..ed9c91b 100644
--- a/readline/rltty.c
+++ b/readline/rltty.c
@@ -39,6 +39,10 @@
#if defined (GWINSZ_IN_SYS_IOCTL)
# include <sys/ioctl.h>
+#else
+int ioctl(int, unsigned long, ...); /* For Darwin, ioctl() is in "sys/ioctl.h",
+ but except for special control commands,
+ we do not want to include it. */
#endif /* GWINSZ_IN_SYS_IOCTL */
#include "rltty.h"
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] readline: rltty.c: Declare ioctl() explicitly.
2015-04-19 14:25 [PATCH] readline: rltty.c: Declare ioctl() explicitly Chen Gang
@ 2015-04-19 16:46 ` Mike Frysinger
2015-04-19 17:45 ` Chen Gang
0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2015-04-19 16:46 UTC (permalink / raw)
To: Chen Gang; +Cc: binutils, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
On 19 Apr 2015 22:26, Chen Gang wrote:
> Under Darwin, ioctl() is declared in "sys/ioctl.h", but except for some
> special control commands, we do not want to include "sys/ioctl.h". So
> declare it explicitly, the related warning:
readline patches should be sent to the readline project:
https://lists.gnu.org/mailman/listinfo/bug-readline
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] readline: rltty.c: Declare ioctl() explicitly.
2015-04-19 16:46 ` Mike Frysinger
@ 2015-04-19 17:45 ` Chen Gang
0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2015-04-19 17:45 UTC (permalink / raw)
To: binutils, gdb-patches
On 4/20/15 00:46, Mike Frysinger wrote:
> On 19 Apr 2015 22:26, Chen Gang wrote:
>> Under Darwin, ioctl() is declared in "sys/ioctl.h", but except for some
>> special control commands, we do not want to include "sys/ioctl.h". So
>> declare it explicitly, the related warning:
>
> readline patches should be sent to the readline project:
> https://lists.gnu.org/mailman/listinfo/bug-readline
> -mike
>
OK, thanks. I shall send it to bug-readline@gnu.org, next.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-19 17:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-19 14:25 [PATCH] readline: rltty.c: Declare ioctl() explicitly Chen Gang
2015-04-19 16:46 ` Mike Frysinger
2015-04-19 17:45 ` Chen Gang
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).