On Thu, Feb 12, 2026 at 11:46:00AM +0800, Kevin J. McCarthy wrote:
On Wed, Feb 11, 2026 at 06:21:12PM +0100, Rene Kita wrote:commit 9b4284ade52b786e665c2daf8a784588a580a127 Author: Rene Kita <[email protected]> Date: 2026-02-04T10:02:29+01:00Fix build error for --without-wc-funcs on FreeBSD mbyte.c:417:5: error: redefinition of '__wcwidth' 417 | int wcwidth (wchar_t wc)Let me take another look at this. I haven't studied this area much, so I'd like to understand how mutt even compiles if wchar.h is missing.I wish the folks who had written all this stuff were still active... :-(
I'm poking around a bit more, and I have a few questions that maybe someone on the list can clarify for me.
So, there are some functions defined in wctype.h and some in wchar.h. In mutt.h we have: #ifdef HAVE_WCHAR_H # include <wchar.h> #endif #if defined(HAVE_WCTYPE_H) && defined(HAVE_WC_FUNCS) # include <wctype.h> #endifSo when mutt is configured --without-wc-funcs, mutt will not include wctype.h even if it exists. However, wchar.h will be included regardless if it exists.
In mbyte.c, however, we have a whole block of functions that are defined inside #ifndef HAVE_WC_FUNCS. Some of which are declared in wctype.h, but some of which are delcared in wchar.h.
The ones in wchar.h include wcrtomb(), mbrtowc(), and wcwidth(). So, in this case, why are we only getting in trouble with wcwidth(), but not the first two?If we're configuring --without-wc-funcs, do we really want to use the system version of wcwidth() even if wchar.h exists?
Thanks to anyone who can help. I've never delved into the intricacies of dealing with wchar.h and wctype.h and find the whole thing, combined with --without-wc-funcs, a bit confusing.
-- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature
