Sat 29 Apr 2017 12:35:04 PM UTC, original submission:
Nano 2.8.1 gives warning "Unexpected large character size" if it has been compiled for musl-libc with UTF8 disabled in nano configuration.
root@router2:~# nano
Unexpected large character size: 4 bytes -- please report a bug
Can that warning be seen as cosmetics and be patched away?
Or is it an actual warning that something might go wrong internally in nano?
Compiling nano with UTF8 support makes the warning go away but increases its size by some 4%.
Musl is a popular small libc for embedded devices and the relevant changes in it (see below) have been already in 2015. Nano 2.7.5 has worked quite ok with the same configure options. The warning has surfaced with the move to 2.8.1.
My interpretation:
nano 2.8.1 has a new warning about possible inconsistency (no UTF8 support active in nano while according to locale the max. char length is more than 1). Musl libc sets MB_CUR_MAX to 4 unless the locale is explicitly set to C, when the value is 1. And that seems to trigger the new warning in nano as 4>1.
Context:
Openwrt/LEDE, routers & embedded devices, Linux kernel 4.4 and 4.9, musl-libc C library
Configure options in used in nano compilation:
CONFIGURE_ARGS += --enable-tiny --disable-utf8 -without-slang --disable-color
CONFIGURE_VARS += ac_cv_header_regex_h=no
$ ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build=x86_64-linux-gnu --program-prefix= --program-suffix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls --enable-tiny --disable-utf8 --without-slang --disable-color
Relevant pull request in Openwrt/LEDE packages repo:
https://github.com/openwrt/packages/pull/4286
Relevant commits causing the warning to get triggered:
http://git.savannah.gnu.org/cgit/nano.git/commit/?id=aedc3ddd49b50fcee73ad76e193ab0a2c68f4adf
http://git.musl-libc.org/cgit/musl/commit/?id=1507ebf837334e9e07cfab1ca1c2e88449069a80
http://git.musl-libc.org/cgit/musl/commit/?id=f22a9edaf8a6f2ca1d314d18b3785558279a5c03
|