From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 82E623858C2C; Sat, 3 Sep 2022 23:29:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82E623858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662247742; bh=2rggEcqvU4Bfhn4AK83+rrtNtaeM1Winzs3qq6bETXc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Sb3N/2csV54Babp8utp+d0IdftX5XERLmyt9gYmi7lwzhGQymcQLIjyOFXWN+AqiS O6DUHQ9qUVOlP47wNBI1436J05fQ1QQIj33JogMc97ki0szR53nb5uI3S1+NjSiIwV P3uPBPMKrcaPOrbOrCYRYfs9RZALA0spdtNWSbV0= From: "patrick at monnerat dot net" To: gdb-prs@sourceware.org Subject: [Bug cli/29315] Completion warning: could not convert ... from the host encoding (ANSI_X3.4-1968) to UTF-32 Date: Sat, 03 Sep 2022 23:29:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick at monnerat dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29315 --- Comment #3 from Patrick Monnerat --- (In reply to Tom Tromey from comment #2) Thanks for your reply. > Are there any defines in the mingw libiconv headers that could be used > to detect this situation? Not at all :-( I already checked it. It only declares iconv_t, iconv_open(), iconv_close() and iconv(). > Anyway I'd be curious to know exactly which situation makes gdb decide > not to use iconv in your configuration. HAVE_ICONV defined HAVE_BTOWC defined __STDC_ISO_10646__ undefined (sizeof(wchar_t) =3D 2) _LIBICONV_VERSION undefined Annotated lines from gdb/gdb_wchar.h #if defined (HAVE_ICONV) ; defined, so iconv.h is included. #if defined (HAVE_ICONV) && defined (HAVE_BTOWC) \ && (defined (__STDC_ISO_10646__) \ || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >=3D 0x108)) ; evaluates to false #else /* If we got here and have wchar_t support, we might be on a system with some problem. So, we just disable everything. */ #if defined (HAVE_BTOWC) #define PHONY_ICONV ; <---- decision made here. #endif > One question I had is whether the required iconv converters are installed. > It sounds like he's using glibc... Of course, if Maciej has no libiconv at all, it'll always use phony iconv ! Glibc iconv.h does not define _LIBICONV_VERSION: if he uses it and sizeof(wchar_t) =3D=3D 2, then phony is also enabled. The problem does not exist on Linux as sizeof(wchar_t) =3D=3D 4. > In the past we couldn't assume host iconv was any good. Solaris in > particular was broken (I forget how). I suppose I'm ok with changing > this decision though it might be good to find out how Solaris is doing. I don't have a Solaris platform here for tests. encode_1()=20 Alternative solutions are: - A config parameter for iconv UTF32 support. If not provided, try to deter= mine it via AC_TRY_RUN and assume not supported in cross-builds. - Determine libiconv usability at run-time and switch to phony if needed. - Extend phony iconv to support conversions to UTF32. - Rework conversions in gdb/ada-lang.c, if feasible. - In ada_fold_name(), pre-check for non-ascii codes like it is done in ada_encode_1() and do not convert if none. --=20 You are receiving this mail because: You are on the CC list for the bug.=