From nobody Fri Feb 02 18:36:35 2024 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 4TRPcy3zCPz59Fq6 for ; Fri, 2 Feb 2024 18:36:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 4TRPcy2XF3z4hpC for ; Fri, 2 Feb 2024 18:36:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-55f279dca99so3487093a12.3 for ; Fri, 02 Feb 2024 10:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1706899007; x=1707503807; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=47aD4gdEdOcTJBHHdjcWMq/LJwu2uJ4DpCWhYm6q4yY=; b=rC6G2VfKPUtdZfgVf3QJZYbTOGNnj3PF/7I33DURXTW9pdhqZJB2/JRhy9colBK1vM ISgzoJoz4sOUFMMeMB1YAk7adjKOP82ai+8a52bQ+6OgEuXySVNNxeLVynN1xvX/wsTX Jo4IZ1r1hByR/MMnLCRUtMeiQD5283mQlei3fXn48v9d5vIg9sN4EA247UHCI4L4yL1C fTsoG9vKBQhqUXGcZBpvnfnDW31FD8DQMNA+MF6fj40yjjNFdIReqLe8Akw+ipDy3kAN WhXYpwYvg0rb27bNE+EuLQAJ+iGi71k83gknUO4itWybEYmY+R9AgCXdYB0zVkwg5ag+ X8pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706899007; x=1707503807; 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=47aD4gdEdOcTJBHHdjcWMq/LJwu2uJ4DpCWhYm6q4yY=; b=ZAl9/NZmPqvIuuCzaJKn0Gb3+ChL6bhJkVO+A715+NVEoafP+Opa8lASyTY+LRLVIC 6gZOX+4dUWqdeDapjsucPPkkpfhFS3+4NuuuFqAoej1QtEqCGvgyuyJfwuXhOjccGKL5 UmD08IXtawxPMjGZru3+OIRlOWfHt7SyCOgTpL1e2utcDsw1mz3i+2yz1wjUuSCcfLJz tNvawN+7yvUjIptz2vAx8txfb0vtI8QNRGNWGGV1aGo0Bhzo7zCBrSI64QAe+Ar9FTap a/qHDnb+9oSuc6syPsSLV3FiZ76vxB2KAuZQvVeDI1Qnswq4rj5oTJhJS1NirOfgCYu8 QVwg== X-Gm-Message-State: AOJu0YzgN53rwM+ZaTT1paoatBYuXJfjPG+eCjphGQ18YtADGu6Wz5Z7 oSLtNzjB3GRfaipb+CI9kGEg6Rtjp9M7y/D/9tPUvm46NiaA5HMCpODklj3xjkZNsP1NvLVKeUB zfENHwvtNSM20sPrum4PzdL0synzpX3l1g+GI5Q== X-Google-Smtp-Source: AGHT+IHVFbLec/8QVWOsYFP3IGFngyLqN0NWhFcTWEXZ69zqWuwjwLq7+ydS/GsNeg0SZ/5UF3ETzI7kC1gGsa4frX8= X-Received: by 2002:aa7:d890:0:b0:560:799:f802 with SMTP id u16-20020aa7d890000000b005600799f802mr347291edq.21.1706899007419; Fri, 02 Feb 2024 10:36:47 -0800 (PST) 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: <202402021816.412IGxAl070009@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Fri, 2 Feb 2024 11:36:35 -0700 Message-ID: Subject: Re: git: c27a89971805 - main - stdlib.h: add __noexcept to prototypes To: Konstantin Belousov Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="0000000000000149be06106a659a" X-Rspamd-Queue-Id: 4TRPcy2XF3z4hpC X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --0000000000000149be06106a659a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 2, 2024, 11:28=E2=80=AFAM Konstantin Belousov wrote: > On Fri, Feb 02, 2024 at 06:16:59PM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dc27a89971805b176dcfa5a234f2ea6f= 6109d0a70 > > > > commit c27a89971805b176dcfa5a234f2ea6f6109d0a70 > > Author: Lexi Winter > > AuthorDate: 2024-02-02 16:41:40 +0000 > > Commit: Warner Losh > > CommitDate: 2024-02-02 18:11:17 +0000 > > > > stdlib.h: add __noexcept to prototypes > > > > The noexcept specifier is required on these functions in C++: > > _Exit(), atexit(), quick_exit(), at_quick_exit(), abort(). > > > > MFC after: 2 weeks > > > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1085 > > --- > > include/stdlib.h | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/include/stdlib.h b/include/stdlib.h > > index ff8991d1fa94..f0687f01e6c7 100644 > > --- a/include/stdlib.h > > +++ b/include/stdlib.h > > @@ -84,9 +84,9 @@ extern int __mb_cur_max; > > extern int ___mb_cur_max(void); > > #define MB_CUR_MAX ((size_t)___mb_cur_max()) > > > > -_Noreturn void abort(void); > > +_Noreturn void abort(void) __noexcept; > > int abs(int) __pure2; > > -int atexit(void (* _Nonnull)(void)); > > +int atexit(void (* _Nonnull)(void)) __noexcept; > > double atof(const char *); > > int atoi(const char *); > > long atol(const char *); > > @@ -154,7 +154,7 @@ unsigned long long > > strtoull(const char * __restrict, char ** __restrict, int); > > #endif /* __LONG_LONG_SUPPORTED */ > > > > -_Noreturn void _Exit(int); > > +_Noreturn void _Exit(int) __noexcept; > > #endif /* __ISO_C_VISIBLE >=3D 1999 */ > > > > /* > > @@ -163,9 +163,9 @@ _Noreturn void _Exit(int); > > #if __ISO_C_VISIBLE >=3D 2011 || __cplusplus >=3D 201103L > > void * aligned_alloc(size_t, size_t) __malloc_like > __alloc_align(1) > > __alloc_size(2); > > -int at_quick_exit(void (*)(void)); > > +int at_quick_exit(void (*)(void)) __noexcept; > > _Noreturn void > > - quick_exit(int); > > + quick_exit(int) __noexcept; > This is wrong, libc quick_exit() does not provide such guarantees as > implemented. More, being part of libc it cannot ever guarantee that ever > (and call std::terminate if the requirement is violated). > > Making it such would require bringing some C++ ABI into libc which I > object strongly. > So is this just for quick_exit, or all the functions marked? Warner > > #endif /* __ISO_C_VISIBLE >=3D 2011 */ > > /* > > * Extensions made by POSIX relative to C. > --0000000000000149be06106a659a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Feb 2, 2024, 11:28=E2=80=AFAM Konstantin Belou= sov <kostikbel@gmail.com> = wrote:
On Fri, Feb 02, 2024 at 06:1= 6:59PM +0000, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc27a89971805b176dcfa5a234f2ea6= f6109d0a70
>
> commit c27a89971805b176dcfa5a234f2ea6f6109d0a70
> Author:=C2=A0 =C2=A0 =C2=A0Lexi Winter <lexi@le-Fay.ORG>
> AuthorDate: 2024-02-02 16:41:40 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-02-02 18:11:17 +0000
>
>=C2=A0 =C2=A0 =C2=A0stdlib.h: add __noexcept to prototypes
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0The noexcept specifier is required on these functio= ns in C++:
>=C2=A0 =C2=A0 =C2=A0_Exit(), atexit(), quick_exit(), at_quick_exit(), a= bort().
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Reviewed by: imp
>=C2=A0 =C2=A0 =C2=A0Pull Request: htt= ps://github.com/freebsd/freebsd-src/pull/1085
> ---
>=C2=A0 include/stdlib.h | 10 +++++-----
>=C2=A0 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/stdlib.h b/include/stdlib.h
> index ff8991d1fa94..f0687f01e6c7 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -84,9 +84,9 @@ extern int __mb_cur_max;
>=C2=A0 extern int ___mb_cur_max(void);
>=C2=A0 #define=C2=A0 =C2=A0 =C2=A0 MB_CUR_MAX=C2=A0 =C2=A0 =C2=A0 ((siz= e_t)___mb_cur_max())
>=C2=A0
> -_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 abort(void);
> +_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 abort(void) __noexcept;
>=C2=A0 int=C2=A0 =C2=A0abs(int) __pure2;
> -int=C2=A0 =C2=A0atexit(void (* _Nonnull)(void));
> +int=C2=A0 =C2=A0atexit(void (* _Nonnull)(void)) __noexcept;
>=C2=A0 double=C2=A0 =C2=A0 =C2=A0 =C2=A0 atof(const char *);
>=C2=A0 int=C2=A0 =C2=A0atoi(const char *);
>=C2=A0 long=C2=A0 atol(const char *);
> @@ -154,7 +154,7 @@ unsigned long long
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 strtoull(const char * __restrict, char ** _= _restrict, int);
>=C2=A0 #endif /* __LONG_LONG_SUPPORTED */
>=C2=A0
> -_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 _Exit(int);
> +_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 _Exit(int) __noexcept;
>=C2=A0 #endif /* __ISO_C_VISIBLE >=3D 1999 */
>=C2=A0
>=C2=A0 /*
> @@ -163,9 +163,9 @@ _Noreturn void=C2=A0 =C2=A0 =C2=A0_Exit(int);
>=C2=A0 #if __ISO_C_VISIBLE >=3D 2011 || __cplusplus >=3D 201103L<= br> >=C2=A0 void *=C2=A0 =C2=A0 =C2=A0 =C2=A0aligned_alloc(size_t, size_t) _= _malloc_like __alloc_align(1)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__alloc_size(2);
> -int=C2=A0 at_quick_exit(void (*)(void));
> +int=C2=A0 at_quick_exit(void (*)(void)) __noexcept;
>=C2=A0 _Noreturn void
> -=C2=A0 =C2=A0 =C2=A0quick_exit(int);
> +=C2=A0 =C2=A0 =C2=A0quick_exit(int) __noexcept;
This is wrong, libc quick_exit() does not provide such guarantees as
implemented. More, being part of libc it cannot ever guarantee that ever (and call std::terminate if the requirement is violated).

Making it such would require bringing some C++ ABI into libc which I
object strongly.

So is this just for quick_exit, or all the functions marked= ?

Warner=C2=A0


>=C2=A0 #endif /* __ISO_C_VISIBLE >=3D 2011 */
>=C2=A0 /*
>=C2=A0 =C2=A0* Extensions made by POSIX relative to C.
--0000000000000149be06106a659a--