Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Chen Gang <xili_gchen_5257@hotmail.com>
To: binutils@sourceware.org,
	 "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH] readline: rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled.
Date: Sun, 19 Apr 2015 11:42:00 -0000	[thread overview]
Message-ID: <BLU437-SMTP66A78F9AC964A2A53B15ECB9E10@phx.gbl> (raw)

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


             reply	other threads:[~2015-04-19 11:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-19 11:42 Chen Gang [this message]
2015-04-19 15:44 ` Andreas Schwab
2015-04-19 18:46   ` Chen Gang

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=BLU437-SMTP66A78F9AC964A2A53B15ECB9E10@phx.gbl \
    --to=xili_gchen_5257@hotmail.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@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