From nobody Fri Feb 02 19:02:39 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 4TRQC01NHfz59HfM for ; Fri, 2 Feb 2024 19:02:52 +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 4TRQC00zWKz4lTF for ; Fri, 2 Feb 2024 19:02:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5600f79607eso273189a12.0 for ; Fri, 02 Feb 2024 11:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1706900570; x=1707505370; 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=ni3x6CK4tP5Ly/Wz5VZXhdC93Vxu3aFdbnkKP4pgzFo=; b=ua1X6rkozmAg4wslckFIwuEnrKIY7XcDLpvnv1DHe6lqDbfpE96qVQfOkmz5yHBL5B yR6AbPPk6nwtzIb7SzuK3+VuouuCqIeWSoGj6ZQWjUUKdWozfpvcTFC7wHbLPFEjkKsu ZqX1BqwEmLoSwBfJchVOxVdViWnsWG3v+nEE+7W++J8MqlHZzd1wSFfn7Vxo6B0u5OIi 2YiLMRHyBFGHH1Yn7vZGhM8ED1ezdRUbZEnsvyE8kbVjaKBIrbne40UN6kvF9kZyl1Wm pYdF4vxUVvSK9odRRmXfWcj28jFvwVbkuAZiGDr9N31abmVvR6wQlKiVIuYXrZGXSGaV nXeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706900570; x=1707505370; 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=ni3x6CK4tP5Ly/Wz5VZXhdC93Vxu3aFdbnkKP4pgzFo=; b=t5rsO54WI9i2nhaCrObvOFTb88Yl5dEvFKHKCyRGnM3kBMJwpujKIQdmkFtKWVZFrO 81ISfdIA+BhTP51vEZty6KUy6pTvEwWBNWT3Id2Z6UwGHIaClY6RqbV8xk1kUEAv5Aqx 09jZxpWr77oYqbp0VPFaL3JegeMnWhl6M2iXnu2O7aXAH/3w0oSqjTsyne84pihZvNfN 16Fr8SnPSz4jPVXRW5zngq0JbawCukKOTcCmtqZ6mO9cH4D9dZ1TQpo32GvaMkKfTEoo wr9InYCm2rOF2XvkLyzXQV+8ByOhxftny6qDeViopvMpUBOqwWh3A4dynd3Qd2VHiufk SYSg== X-Gm-Message-State: AOJu0YwU1nJOTaOkgus53GSqDZiQzwluSJMSFxG1AGOVcapoE/W2i0Pm LATMVbBgMKvctj2jXFeimL/LkXcEnTo5e9nuXsOLATvAPvfIviO28e6UuAGYGYurhpoJGQGdN12 Z4r3hloHlKSjNPlzonokvng9kuM7suOINk4St+Q== X-Google-Smtp-Source: AGHT+IFqTih9cYxLjaHB474hzESKwWjFkPvrPLD/RT44aEeaB725ow0D239oY8OHsQ7L5nDzQjEyWclxJlHWctnstXI= X-Received: by 2002:aa7:d059:0:b0:55f:f692:90d6 with SMTP id n25-20020aa7d059000000b0055ff69290d6mr397342edo.23.1706900570542; Fri, 02 Feb 2024 11:02:50 -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 12:02:39 -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="0000000000002ca5bf06106ac272" X-Rspamd-Queue-Id: 4TRQC00zWKz4lTF 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] --0000000000002ca5bf06106ac272 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 2, 2024 at 11:59=E2=80=AFAM Konstantin Belousov wrote: > On Fri, Feb 02, 2024 at 11:36:35AM -0700, Warner Losh wrote: > > 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? > Other functions are abort()/_Exit()/atexit(). No functions in this list > call a user-provided functions, so they cannot raise exceptions. > > My objection is only against our quick_exit(). > OK. I'll back that one out. Warner --0000000000002ca5bf06106ac272 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Feb 2, 2024 at 11:59=E2=80=AF= AM Konstantin Belousov <kostikbel= @gmail.com> wrote:
On Fri, Feb 02, 2024 at 11:36:35AM -0700, Warner Losh wrote:
> On Fri, Feb 2, 2024, 11:28=E2=80=AFAM Konstantin Belousov <kostikbel@gmail.com&g= t;
> 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=3Dc27a89971805b176dcfa5a234f2ea6f6109d0a70<= /a>
> > >
> > > commit c27a89971805b176dcfa5a234f2ea6f6109d0a70
> > > Author:=C2=A0 =C2=A0 =C2=A0Lexi Winter <lexi@le-Fay.ORG&g= t;
> > > AuthorDate: 2024-02-02 16:41:40 +0000
> > > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org&g= t;
> > > CommitDate: 2024-02-02 18:11:17 +0000
> > >
> > >=C2=A0 =C2=A0 =C2=A0stdlib.h: add __noexcept to prototypes > > >
> > >=C2=A0 =C2=A0 =C2=A0The noexcept specifier is required on the= se functions in C++:
> > >=C2=A0 =C2=A0 =C2=A0_Exit(), atexit(), quick_exit(), at_quick= _exit(), abort().
> > >
> > >=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks > > >
> > >=C2=A0 =C2=A0 =C2=A0Reviewed by: imp
> > >=C2=A0 =C2=A0 =C2=A0Pull Request:
http= s://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 ((size_t)___mb_cur_max())
> > >
> > > -_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 abort(void);
> > > +_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 abort(void) __noe= xcept;
> > >=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 *);<= br> > > >=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 */
> > >
> > > -_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 _Exit(int);
> > > +_Noreturn void=C2=A0 =C2=A0 =C2=A0 =C2=A0 _Exit(int) __noex= cept;
> > >=C2=A0 #endif /* __ISO_C_VISIBLE >=3D 1999 */
> > >
> > >=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
> > >=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 th= at ever
> > (and call std::terminate if the requirement is violated).
> >
> > Making it such would require bringing some C++ ABI into libc whic= h I
> > object strongly.
> >
>
> So is this just for quick_exit, or all the functions marked?
Other functions are abort()/_Exit()/atexit(). No functions in this list
call a user-provided functions, so they cannot raise exceptions.

My objection is only against our quick_exit().

OK. I'll back that one out.

Warner=C2= =A0
--0000000000002ca5bf06106ac272--