From nobody Tue Sep 12 17:24:20 2023 X-Original-To: numerics@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RlVnK21rvz4tF6X for ; Tue, 12 Sep 2023 17:24:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RlVnJ5thBz4M1p for ; Tue, 12 Sep 2023 17:24:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694539460; a=rsa-sha256; cv=none; b=gEXcLHAipy1dztfVGAHx5yrE83oOkefOiN6Xjce7HL2JFs/XcfXUyz480092CC22CzxJgU 2+Pj5Cv5yMOigicvW/ZpZmh5526KxT6kf37CfqlHie3EHwRebH1zv4Cqtt+4TxmUS9cRWQ 2ECM2dnqKd5VwKIul9ctkOEvd3kqi6lehK/EbfHiMu8P8SLLGMF9x9zb7TX2lk1CKf75MK RbkuDuz3+MiR3XitMHJUqCN02Ri9vssHeE36kG/0RA/VyvzKonYMadA9x8hdDUGr4CNgcf VOF6fkED7VXBsbBlB5nGH8CtvgLZvgpYeODbyluN5qhMmE/WbEhsSelO7agQLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694539460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OwPKywTSrIXG4q/gCBbmUaIbslXp8dG5F3edGmcSmEY=; b=IaRW1rvc6NB9J8JPYIXblIg2F5FUVZxH/Adc89H4yzM1GVIX7ZD5cM8rgLLqUZUP/U5rYF TdpJN2vTBwEy6L3oXe9fR6GXSX1S8dpwOgaTS5LBDUd9CDhiMsKuU+Y7+LfAFVQ/qF3070 EsYL3DE19neeqoajarYTC7EPXth7YapFaj6tRqs8Xp6PN0yXLp5lFzG0Vk58rL1c9k+yBG wLjO6Xeuii8bV0QsvfhzJDV4RloOUz6QG5XUiuAA2QlcIJ2iDPAqOAMItTn65PpPjxczFT 6/UZ6PBnp8pT5nRQEVK7u4KELQTtcmX/rlENwJhpRKIgtceixSDkUU3xeOoWBw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RlVnJ4zMNzgvl for ; Tue, 12 Sep 2023 17:24:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38CHOKkS016417 for ; Tue, 12 Sep 2023 17:24:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38CHOKLV016416 for numerics@FreeBSD.org; Tue, 12 Sep 2023 17:24:20 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: numerics@FreeBSD.org Subject: [Bug 272758] c16rtomb and c32rtomb wrong return value (at least on aarch64) Date: Tue, 12 Sep 2023 17:24:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: numerics@FreeBSD.org 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: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussions of high quality implementation of libm functions List-Archive: https://lists.freebsd.org/archives/freebsd-numerics List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-numerics@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272758 --- Comment #3 from Dimitry Andric --- (In reply to John F. Carr from comment #1) Yes, setting the mbstate_t to zero is what should be done. Quoting C11 7.29= .6: > The initial conversion state corresponds, for a conversion in either dire= ction, to the beginning of a new multibyte character in the initial shift s= tate. A zero-valued mbstate_t object is (at least) one way to describe an i= nitial conversion state. A zero- valued mbstate_t object can be used to ini= tiate conversion involving any multibyte character sequence, in any LC_CTYP= E category setting. If an mbstate_t object has been altered by any of the f= unctions described in this subclause, and is then used with a different mul= tibyte character sequence, or in the other conversion direction, or with a = different LC_CTYPE category setting than on earlier function calls, the beh= avior is undefined. --=20 You are receiving this mail because: You are the assignee for the bug.=