From nobody Fri Oct 07 18:16:22 2022 X-Original-To: dev-commits-src-all@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 4Mkc2Y3H44z4V86B; Fri, 7 Oct 2022 18:16:37 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mkc2Y0DFPz3Nkw; Fri, 7 Oct 2022 18:16:37 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-ej1-x62f.google.com with SMTP id 13so13052402ejn.3; Fri, 07 Oct 2022 11:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CH5S5uaQ/fmVYzeW+Y8+6+hLimeFhEnYI3pNF7FhSew=; b=JMFMhA4+SCbH4Sy3WD577D2sLX8dG8QPD6UzZ/K0chT1n3t+kK24Dsm1AEsswREO0v 8Y0fIJYhB2FiCgmKKF5gRx6iuJZL+KEy0zGrQocnw7DG/qU0UXUAYhoFo2n8tNrkvv+I pCkub1wsMIPmXa3x20Xhg6BvQg1zes2Zsyi66/wk+8tao5OGvYs5Quv8Qjo8iWs8FDH/ bLuHuzZcWpedZCV50/4r1WnKBGwIh1pFqZSP27PfnniuZWBcntAyeEdIQHByn69B9/EP YN1uRKOKtDIDWRGnHTFtUPRbH4wn0lMX7EyeOkG2wmcgBHbzzhKFzZY+IaP4k0tbp7zb I3/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CH5S5uaQ/fmVYzeW+Y8+6+hLimeFhEnYI3pNF7FhSew=; b=yVToWzA9k/4JQc9TUYtRY9XlUsXRXLsJP4DwVi7MjLlayL5ogMXHidawyn2uX4WMJr poCq81KlLfTyfDxj4Q1cib9g1+WULeYLZ4SvKJq1pDAyIvivKEGY/4782D/w3Y6eYjZm v6ZcTSISNFri8lxKc19qxjKDzgxXvUtB1GswCa9PzigVxF7DcBsRUbWlc9NiZxT1YuzO rauO1dpv9ftFvmBqlgyFE66c3kahP3hIht/HVtn93mhjF/RgqkuaWrdWosMcgH0Djr3b 7zfrH1tCTEV7fbdzAZimo7GpTJjIPVGM1dneWnrkeOl2+l7ZMyQaZYh8aqpp9olTpjcs Jb8g== X-Gm-Message-State: ACrzQf1qnffzSN3dt3AakVZ+9i3uZ86dUE6nMeLTkOExbNwJQzAiBpUc 8dVgLrAuHzQmFWxc38HciyqPFKoF4WeDYIlY5AKG9mJ0xJo= X-Google-Smtp-Source: AMsMyM4pdLRFimtRyMKunmnNzfmzNJK/ubg3igldWmsT2kYMRENqxgjyyzaZ6MLvUtnuvzadcF5x297RX1FxUcLMF3g= X-Received: by 2002:a17:906:fe46:b0:730:ca2b:cb7b with SMTP id wz6-20020a170906fe4600b00730ca2bcb7bmr5273635ejb.703.1665166595036; Fri, 07 Oct 2022 11:16:35 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202209302230.28UMUq4I029171@gitrepo.freebsd.org> In-Reply-To: From: Xin LI Date: Fri, 7 Oct 2022 11:16:22 -0700 Message-ID: Subject: Re: git: af3c78886fd8 - main - Alter the prototype of qsort_r(3) to match POSIX, which adopted the glibc-based interface. To: Alexey Dokuchaev Cc: Xin LI , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000639b2805ea75cfe6" X-Rspamd-Queue-Id: 4Mkc2Y0DFPz3Nkw X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=JMFMhA4+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of delphij@gmail.com designates 2a00:1450:4864:20::62f as permitted sender) smtp.mailfrom=delphij@gmail.com X-Spamd-Result: default: False [-3.96 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.99)[-0.993]; NEURAL_HAM_SHORT(-0.96)[-0.963]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62f:from]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[delphij]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N --000000000000639b2805ea75cfe6 Content-Type: text/plain; charset="UTF-8" On Fri, Oct 7, 2022 at 6:12 AM Alexey Dokuchaev wrote: > On Fri, Sep 30, 2022 at 10:30:52PM +0000, Xin LI wrote: > > commit af3c78886fd8d4ca5eebdbe581a459a6f6d29d6a > > > > Alter the prototype of qsort_r(3) to match POSIX, which adopted the > > glibc-based interface. > > > > Unfortunately, the glibc maintainers, despite knowing the existence > > of the FreeBSD qsort_r(3) interface in 2004 and refused to add the > > same interface to glibc based on grounds of the lack of standardization > > and portability concerns, has decided it was a good idea to introduce > > their own qsort_r(3) interface in 2007 as a GNU extension with a > > slightly different and incompatible interface. > > > > With the adoption of their interface as POSIX standard, let's switch > > to the same prototype, there is no need to remain incompatible. > > What a sad story, and so unfair to FreeBSD as we now have to deal with > compatibility hacks (as mandree@ had said, having to parenthesize a > function name is an abomination). Can you elaborate on technical side of > things a bit? Is GNU qsort_r(3) interface, while incompatible, better > They only have to parenthesize when they are utilizing C language features to accomplish a special goal (e.g. to detect if the prototype matches exactly in a configure script) which have a better alternative (by enabling strict type checks), or are doing something wrong (e.g. not including the correct header file). No normal usages of qsort_r(3) required parenthesize, unless they are already broken. > than ours in 1-to-1 comparison, leaving the grief of not going with our > older one aside? Thanks, > It's already explained in the commit message. Cheers, --000000000000639b2805ea75cfe6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Oct 7, 2022 at 6:12 AM Alex= ey Dokuchaev <danfe@freebsd.org= > wrote:
On F= ri, Sep 30, 2022 at 10:30:52PM +0000, Xin LI wrote:
> commit af3c78886fd8d4ca5eebdbe581a459a6f6d29d6a
>
>=C2=A0 =C2=A0Alter the prototype of qsort_r(3) to match POSIX, which ad= opted the
>=C2=A0 =C2=A0glibc-based interface.
>
>=C2=A0 =C2=A0Unfortunately, the glibc maintainers, despite knowing the = existence
>=C2=A0 =C2=A0of the FreeBSD qsort_r(3) interface in 2004 and refused to= add the
>=C2=A0 =C2=A0same interface to glibc based on grounds of the lack of st= andardization
>=C2=A0 =C2=A0and portability concerns, has decided it was a good idea t= o introduce
>=C2=A0 =C2=A0their own qsort_r(3) interface in 2007 as a GNU extension = with a
>=C2=A0 =C2=A0slightly different and incompatible interface.
>
>=C2=A0 =C2=A0With the adoption of their interface as POSIX standard, le= t's switch
>=C2=A0 =C2=A0to the same prototype, there is no need to remain incompat= ible.

What a sad story, and so unfair to FreeBSD as we now have to deal with
compatibility hacks (as mandree@ had said, having to parenthesize a
function name is an abomination).=C2=A0 Can you elaborate on technical side= of
things a bit?=C2=A0 Is GNU qsort_r(3) interface, while incompatible, better=

They only have to parenthesize when they a= re utilizing C language features to accomplish a special goal (e.g. to dete= ct if the prototype matches exactly in a configure script) which have a bet= ter alternative (by enabling strict type checks), or are doing something wr= ong (e.g. not including the correct header file).

No normal us= ages of qsort_r(3) required parenthesize, unless they are already broken.
=C2=A0
than ours in 1-to-1 comparison, leaving the grief of not going with our
older one aside?=C2=A0 Thanks,

It's already = explained in the commit message.

Cheers,
--000000000000639b2805ea75cfe6--