From nobody Mon Jul 01 23:09:24 2024 X-Original-To: dev-commits-src-main@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 4WChZT4zkhz5QPWs for ; Mon, 01 Jul 2024 23:09:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WChZT3C8Jz4KkP for ; Mon, 1 Jul 2024 23:09:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-6eab07ae82bso2039785a12.3 for ; Mon, 01 Jul 2024 16:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1719875376; x=1720480176; 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=vdfLXwZu3TCb/T5MvpXiBn8RTJSSyOEZquMos/fJ5Z8=; b=zZMVcIVbbo26dDmfJbpGzaiPW5V0yWaW6hd7XsO/VtQRfk28AbVsQdyUZAeG9Rx/YJ 2ycU5Vqb5EZLFT1Iu4z7x/FbvYAWlIZkk+9wk5JPraRK+JIcT3EwgBcDFxyzKmsS0aw2 VpE90dqiH36RbmJubH6JWcKaKmgzM17ngakjICzRaIm8zss/ZnzFvd/KjwoGMyBmcwnz 1QY517vMRV3Ho/deIxc6JhTypZ0YOq3N4Pu2RA65NS7CKn5dn8afI4GArgwx74Wnhlgs YcNVdE/uvkyhjKVo+vy3GsWfNrHH3hSrhmAFvnEOqf3951r9nf76Vv6TRm//doV2i82Y KNBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719875376; x=1720480176; 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=vdfLXwZu3TCb/T5MvpXiBn8RTJSSyOEZquMos/fJ5Z8=; b=JBa9c/bwKXbdRJOR3UFCWcYCyw929mwbvJukRNDhucjKmN2J+Nw6oMdy8oxwlhIf5b EAkL/lkKCP3O6or84s6aVLL+2dS3CgiIQN65a8m+8v+OzWUo4IyLhhYUYNsUjrLWW6LL ggAmJFJza+D6VGnnPvTtt2wYpNN9Go4TImlnze0lZP5CI0u0Fwd78JPfvzNvu9fsPIAX NJ/w4DL9N2FaYTicCcSwD3oBtqfGES64q8rFE5TJXwF3XLGzS/6cjhkhRg9kh9Wo+eoV VhRypMPIi94KAGt+TAT1G8oyQsKouumjRF9VRqwPfXLcbyoe4sdgT3TsVO+4T7mX7PnE j7Fw== X-Forwarded-Encrypted: i=1; AJvYcCVNpLGqdOAaUa/NuwM/Mgvw1my0ucHV43MgvnQvJHXagp2nR7BcaW1WNDSZd1QJqy3TUUwvLoUnmmv+qKO1UvMbKGe8+U0Q2yMQ5DN1BhjkRA== X-Gm-Message-State: AOJu0Yzi44uNUy0cdmJmSWaaCrwj+480Qo6w8+0Jy43DsHBPwJ1p4kAX MiO4u5+QLtlW+3mmJVKsqgd1OnJJy275/4f1Ya92HEcVNZZm4RUBVsyTLtArPKQsDiFnq96QwEL dWWy8c+OLY5Rxbr+9xb5svLUoZAcu4E5LsIMmONGy0QYg1BgWL7Y= X-Google-Smtp-Source: AGHT+IEsUzvr4lNcmEdrzaBo770pg4L7lXV0h0uw4a+d1MN//QFOoiv5Lf9/kexf35+r9snBoYg0o24VZt1ndXN0/7A= X-Received: by 2002:a05:6a20:2448:b0:1be:2e11:2aa2 with SMTP id adf61e73a8af0-1bef6109dc2mr6283681637.22.1719875376048; Mon, 01 Jul 2024 16:09:36 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> In-Reply-To: <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> From: Warner Losh Date: Mon, 1 Jul 2024 17:09:24 -0600 Message-ID: Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 To: John Baldwin Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000d90221061c37b0ad" 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:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WChZT3C8Jz4KkP --000000000000d90221061c37b0ad Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin wrote: > On 6/20/24 7:41 PM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc2= 71d38be7d > > > > commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d > > Author: Warner Losh > > AuthorDate: 2024-06-20 23:02:56 +0000 > > Commit: Warner Losh > > CommitDate: 2024-06-21 02:41:08 +0000 > > > > cdefs.h: Remove support for pre gcc 4.0 > > > > All supported compilers support the gcc 3 attribute extensions. > Remove > > the #else clauses for this. Also, latter-day pcc compilers also > define > > __GNUC__, so there's not need to also test for __PCC__. > > > > Reviewed by: brooks > > Differential Revision: https://reviews.freebsd.org/D45654 > > Sponsored by: Netflix > > --- > > sys/sys/cdefs.h | 42 ++++-------------------------------------- > > 1 file changed, 4 insertions(+), 38 deletions(-) > > > > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > > index 88019819eb35..a6ecdca5d8b9 100644 > > --- a/sys/sys/cdefs.h > > +++ b/sys/sys/cdefs.h > > @@ -408,15 +389,10 @@ > > * assign pointer x to a local variable, to check that its type is > > * compatible with member m. > > */ > > -#if __GNUC_PREREQ__(3, 1) > > #define __containerof(x, s, m) ({ > \ > > const volatile __typeof(((s *)0)->m) *__x =3D (x); = \ > > __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ > > }) > > -#else > > -#define __containerof(x, s, m) > \ > > - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) > > -#endif > > > > /* > > * Compiler-dependent macros to declare that functions take printf-li= ke > > @@ -434,14 +410,8 @@ > > #define __strftimelike(fmtarg, firstvararg) \ > > __attribute__((__format__ (__strftime__, fmtarg, firstvararg)= )) > > > > -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. > */ > > -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >=3D 300001 = && \ > > - defined(__GNUC__) > > #define __printf0like(fmtarg, firstvararg) \ > > __attribute__((__format__ (__printf0__, fmtarg, firstvararg))= ) > > -#else > > -#define __printf0like(fmtarg, firstvararg) > > -#endif > > Does this still work with external GCC? I didn't think printf0 was > supported > by external GCC (or maybe I had to readd it in the port and that's what I > remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gccX > ports, but is not available in stock GCC (e.g. lang/gcc does not support > it). > Ah. That would explain why it just worked for me. That's what I tested with. Clang also seemed happy with it. But that was the in tree clang. Is there a similar issue? Gnuc is defined for both. Warner --=20 > John Baldwin > > --000000000000d90221061c37b0ad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin <= jhb@freebsd.org> wrote:
=
On 6/20/24 7:41 PM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc= 271d38be7d
>
> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-06-20 23:02:56 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-06-21 02:41:08 +0000
>
>=C2=A0 =C2=A0 =C2=A0 cdefs.h: Remove support for pre gcc 4.0
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 All supported compilers support the gcc 3 attribut= e extensions. Remove
>=C2=A0 =C2=A0 =C2=A0 the #else clauses for this. Also, latter-day pcc c= ompilers also define
>=C2=A0 =C2=A0 =C2=A0 __GNUC__, so there's not need to also test for= __PCC__.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 brooks
>=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0 h= ttps://reviews.freebsd.org/D45654
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix
> ---
>=C2=A0 =C2=A0sys/sys/cdefs.h | 42 ++++---------------------------------= -----
>=C2=A0 =C2=A01 file changed, 4 insertions(+), 38 deletions(-)
>
> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
> index 88019819eb35..a6ecdca5d8b9 100644
> --- a/sys/sys/cdefs.h
> +++ b/sys/sys/cdefs.h
> @@ -408,15 +389,10 @@
>=C2=A0 =C2=A0 * assign pointer x to a local variable, to check that its= type is
>=C2=A0 =C2=A0 * compatible with member m.
>=C2=A0 =C2=A0 */
> -#if __GNUC_PREREQ__(3, 1)
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__containerof(x, s, m) ({=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
>=C2=A0 =C2=A0 =C2=A0 =C2=A0const volatile __typeof(((s *)0)->m) *__x= =3D (x);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0__DEQUALIFY(s *, (const volatile char *)__x = - __offsetof(s, m));\
>=C2=A0 =C2=A0})
> -#else
> -#define=C2=A0 =C2=A0 =C2=A0 __containerof(x, s, m)=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
> -=C2=A0 =C2=A0 =C2=A0__DEQUALIFY(s *, (const volatile char *)(x) - __o= ffsetof(s, m))
> -#endif
>=C2=A0 =C2=A0
>=C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 * Compiler-dependent macros to declare that functions tak= e printf-like
> @@ -434,14 +410,8 @@
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__strftimelike(fmtarg, firstvar= arg) \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__attribute__((__format__ (__s= trftime__, fmtarg, firstvararg)))
>=C2=A0 =C2=A0
> -/* Compiler-dependent macros that rely on FreeBSD-specific extensions= . */
> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= ;=3D 300001 && \
> -=C2=A0 =C2=A0 defined(__GNUC__)
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__printf0like(fmtarg, firstvara= rg) \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__attribute__((__format__ (__p= rintf0__, fmtarg, firstvararg)))
> -#else
> -#define=C2=A0 =C2=A0 =C2=A0 __printf0like(fmtarg, firstvararg)
> -#endif

Does this still work with external GCC?=C2=A0 I didn't think printf0 wa= s supported
by external GCC (or maybe I had to readd it in the port and that's what= I
remember).=C2=A0 Ah, yes, printf0 is a local patch in the devel/freebsd-gcc= X
ports, but is not available in stock GCC (e.g. lang/gcc does not support it= ).

Ah. That would explain why it just worked for me. That's what I teste= d with. Clang also seemed happy with it. But that was the in tree clang. Is= there a similar issue? Gnuc is defined for both.
Warner

--
John Baldwin

--000000000000d90221061c37b0ad--