Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] readline: rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled.
@ 2015-04-19 11:42 Chen Gang
  2015-04-19 15:44 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2015-04-19 11:42 UTC (permalink / raw)
  To: binutils, gdb-patches

On fedora 20 x86_64, it has wcwidth() in libc.so.6, but does not declare
it if __USE_XOPEN disabled. readline uses libc library, but does not use
XOPEN, so just declare wcwidth() explicitly is OK.

The related warning:

  gcc -c -DHAVE_CONFIG_H    -I. -I../../binutils-gdb/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 ../../binutils-gdb/readline/display.c
  ../../binutils-gdb/readline/display.c: In function ‘rl_redisplay’:
  ../../binutils-gdb/readline/display.c:768:15: warning: implicit declaration of function ‘wcwidth’ [-Wimplicit-function-declaration]
          temp = wcwidth (wc);
                 ^

2015-04-19  Chen Gang  <gang.chen.5i5j@gmail.com>

	* rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled.
---
 readline/ChangeLog.gdb | 4 ++++
 readline/rlmbutil.h    | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb
index 43abd19..a1051aa 100644
--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,7 @@
+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>
 
 	* complete.c (stat_char) [_WIN32]: Don't use 'access' and X_OK on
diff --git a/readline/rlmbutil.h b/readline/rlmbutil.h
index 7716a70..e4cd1f4 100644
--- a/readline/rlmbutil.h
+++ b/readline/rlmbutil.h
@@ -96,6 +96,9 @@ extern int _rl_find_next_mbchar PARAMS((char *, int, int, int));
 
 #ifdef HANDLE_MULTIBYTE
 
+extern int wcwidth (wchar_t __c); /* For fedora 20 x86_64, it has wcwitdh(), but
+				     only declared when __USE_XOPEN.  */
+
 extern int _rl_compare_chars PARAMS((char *, int, mbstate_t *, char *, int, mbstate_t *));
 extern int _rl_get_char_len PARAMS((char *, mbstate_t *));
 extern int _rl_adjust_point PARAMS((char *, int, mbstate_t *));
-- 
1.9.3


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

end of thread, other threads:[~2015-04-19 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-19 11:42 [PATCH] readline: rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled Chen Gang
2015-04-19 15:44 ` Andreas Schwab
2015-04-19 18:46   ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox