From nobody Mon Nov 27 18:13:27 2023 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 4SfDH91nDsz52Q3B for ; Mon, 27 Nov 2023 18:13:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 4SfDH873lrz4XJH for ; Mon, 27 Nov 2023 18:13:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-507e85ebf50so6156977e87.1 for ; Mon, 27 Nov 2023 10:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1701108819; x=1701713619; 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=cMr54PiDt/h8giHJPJtKasGw4wtpiystx4Gt6bjE/S4=; b=sKkBVCgrkdER9VMatngHOPr1fD08GntDkiUWwonDufviO/2iN26WmYfz5Sih8uomjw 7PlGFBxY/b7Dl81lQHmWx1Ui/kqIv/vXKsIr+fSAJo9WSclakod5u1uJX7WZAV/NPw+i qoyu725to/Sg8JBLerHH781A7xqxiZ+69ZLzeOlFDq/0n6W6QSIJtcCApoPTuOfL0Cup Vp5Td0xcZZWh4uySmicot2t1st+8zIJLMArcZfZartTUpt/vLx6ViSpsFdztv2JAkkDR r7vjUerqbcvy4+ofiKkwt4iPz0N4jSxxkvpcgdTF/OUtJp7v0crShrxmHZhAF3UGSR23 qXwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701108819; x=1701713619; 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=cMr54PiDt/h8giHJPJtKasGw4wtpiystx4Gt6bjE/S4=; b=OjyK86uVWBnXrVZz53ZcyRAaMxJYVlBPZ9ojbA8fXF6MXPe+kfM54p8wG6e236IMLi XZaFBHp7E4GzSDQ/ecJ1y2S29oVMZdjKwlh/n3Rcz6jSSjIKc1H3ypCc1mUJTZ7QEcat lSd1HLdzsVaoVBO5g8zK7leFdhlVkmGHfgDEEM9WlGt7sKh3+cu79eKAkhVLCnN31kSr 0NfzW+sKYs1OBWmjAAc9L5o2VEovt54vFR7aoMv0w1kGW0/zQEMtLC0og1DGBdStWe6E dSGJrhHNzzW+WepmDYTpaBV54inwwwgs4t1xLD6UU7sgAXfr+274Zs6Jxo6xDoCCQ1LC BFfg== X-Gm-Message-State: AOJu0YwsEdJ3HfhJbNGnSPeKD9ogO5W4j9MDHwtjSwdhGXe6gpW0LZiU DPvc0If/lRxgmD1Cab/OknabMFI9MsVAbxM2S9UGZA== X-Google-Smtp-Source: AGHT+IF+JsjrIqhKFrpi8r9t3r6ArnSvtpTa6KezVhlQF15Vpa7+VoGJfxBGYqqh4br1H7I9RbtkIftwn/+BA0pm6n0= X-Received: by 2002:a05:6512:280e:b0:507:b17a:709e with SMTP id cf14-20020a056512280e00b00507b17a709emr10310634lfb.1.1701108819048; Mon, 27 Nov 2023 10:13:39 -0800 (PST) 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202311270525.3AR5PK1V067372@gitrepo.freebsd.org> <136388c6-424f-427f-8584-fededcf1cede@FreeBSD.org> In-Reply-To: <136388c6-424f-427f-8584-fededcf1cede@FreeBSD.org> From: Warner Losh Date: Mon, 27 Nov 2023 11:13:27 -0700 Message-ID: Subject: Re: git: 17a238a15fbe - main - cdefs: Remove __func__ define To: John Baldwin Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000e2515f060b264230" 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] X-Rspamd-Queue-Id: 4SfDH873lrz4XJH --000000000000e2515f060b264230 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 27, 2023 at 10:50=E2=80=AFAM John Baldwin wro= te: > On 11/26/23 9:25 PM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D17a238a15fbed01477fbc54744d35cb= ccdb65871 > > > > commit 17a238a15fbed01477fbc54744d35cbccdb65871 > > Author: Warner Losh > > AuthorDate: 2023-11-20 23:34:22 +0000 > > Commit: Warner Losh > > CommitDate: 2023-11-27 05:24:02 +0000 > > > > cdefs: Remove __func__ define > > > > We require an ANSI-C compiler to build the base system. It's > required > > that __func__ work. Remove this define since the only known proble= m > > compilers are ancient history (gcc 2.6 from 1994, almost pre-datin= g > the > > project). 3rd party code that used this define will now need to > provide > > it via some other means when using non-ansi-c compilers. > > > > PR: 275221 (exp-run) > > Sponsored by: Netflix > > --- > > sys/sys/cdefs.h | 40 > ++------------------------------------ > > tests/sys/opencrypto/cryptodevh.py | 4 ---- > > 2 files changed, 2 insertions(+), 42 deletions(-) > > > > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > > index c5b6190077b3..bcbf418f9323 100644 > > --- a/sys/sys/cdefs.h > > +++ b/sys/sys/cdefs.h > > @@ -96,14 +96,9 @@ > > /* > > * The __CONCAT macro is used to concatenate parts of symbol names, > e.g. > > * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfo= o. > > - * The __CONCAT macro is a bit tricky to use if it must work in non-AN= SI > > - * mode -- there must be no spaces between its arguments, and for nest= ed > > - * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can > also > > - * concatenate double-quoted strings produced by the __STRING macro, b= ut > > - * this only works with ANSI C. > > * > > * __XSTRING is like __STRING, but it expands any macros in its > argument > > - * first. It is only available with ANSI C. > > + * first. > > */ > > #if defined(__STDC__) || defined(__cplusplus) > > #define __P(protos) protos /* full-blown ANSI C */ > > @@ -122,33 +117,7 @@ > > #define __inline /* delete GCC keyword */ > > #endif /* ! __CC_SUPPORTS___INLINE */ > > #endif /* !__cplusplus */ > > - > > -#else /* !(__STDC__ || __cplusplus) */ > > -#define __P(protos) () /* traditional C > preprocessor */ > > -#define __CONCAT(x,y) x/**/y > > -#define __STRING(x) "x" > > - > > -#if !defined(__CC_SUPPORTS___INLINE) > > -#define __const /* delete pseudo-ANSI C > keywords */ > > -#define __inline > > -#define __signed > > -#define __volatile > > -/* > > - * In non-ANSI C environments, new programs will want ANSI-only C > keywords > > - * deleted from the program and old programs will want them left alone= . > > - * When using a compiler other than gcc, programs using the ANSI C > keywords > > - * const, inline etc. as normal identifiers should define > -DNO_ANSI_KEYWORDS. > > - * When using "gcc -traditional", we assume that this is the intent; i= f > > - * __GNUC__ is defined but __STDC__ is not, we leave the new keywords > alone. > > - */ > > -#ifndef NO_ANSI_KEYWORDS > > -#define const /* delete ANSI C keywords > */ > > -#define inline > > -#define signed > > -#define volatile > > -#endif /* !NO_ANSI_KEYWORDS */ > > -#endif /* !__CC_SUPPORTS___INLINE */ > > -#endif /* !(__STDC__ || __cplusplus) */ > > +#endif /* __STDC__ || __cplusplus */ > > > > /* > > * Compiler-dependent macros to help declare dead (non-returning) and > > @@ -343,11 +312,6 @@ > > #define __unreachable() ((void)0) > > #endif > > > > -/* XXX: should use `#if __STDC_VERSION__ < 199901'. */ > > -#if !__GNUC_PREREQ__(2, 7) > > -#define __func__ NULL > > -#endif > > - > > #if (defined(__GNUC__) && __GNUC__ >=3D 2) && !defined(__STRICT_ANSI_= _) > || __STDC_VERSION__ >=3D 199901 > > #define __LONG_LONG_SUPPORTED > > #endif > > This removed a lot more than just __func__? > Damn. It looks like future work got folded in here by accident... This is the 'remove support for pure K&R compilers' stuff I've talked about elsewhere. I'll revert and fix. Warner --000000000000e2515f060b264230 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Nov 27, 2023 at 10:50=E2=80= =AFAM John Baldwin <jhb@freebsd.org> wrote:
On= 11/26/23 9:25 PM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL:
https://= cgit.FreeBSD.org/src/commit/?id=3D17a238a15fbed01477fbc54744d35cbccdb65871<= /a>
>
> commit 17a238a15fbed01477fbc54744d35cbccdb65871
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2023-11-20 23:34:22 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-11-27 05:24:02 +0000
>
>=C2=A0 =C2=A0 =C2=A0 cdefs: Remove __func__ define
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 We require an ANSI-C compiler to build the base sy= stem. It's required
>=C2=A0 =C2=A0 =C2=A0 that __func__ work. Remove this define since the o= nly known problem
>=C2=A0 =C2=A0 =C2=A0 compilers are ancient history (gcc 2.6 from 1994, = almost pre-dating the
>=C2=A0 =C2=A0 =C2=A0 project). 3rd party code that used this define wil= l now need to provide
>=C2=A0 =C2=A0 =C2=A0 it via some other means when using non-ansi-c comp= ilers.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 PR: 275221 (exp-run)
>=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=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 40 ++------------------------------------
>=C2=A0 =C2=A0tests/sys/opencrypto/cryptodevh.py |=C2=A0 4 ----
>=C2=A0 =C2=A02 files changed, 2 insertions(+), 42 deletions(-)
>
> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
> index c5b6190077b3..bcbf418f9323 100644
> --- a/sys/sys/cdefs.h
> +++ b/sys/sys/cdefs.h
> @@ -96,14 +96,9 @@
>=C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 * The __CONCAT macro is used to concatenate parts of symb= ol names, e.g.
>=C2=A0 =C2=A0 * with "#define OLD(foo) __CONCAT(old,foo)", OL= D(foo) produces oldfoo.
> - * The __CONCAT macro is a bit tricky to use if it must work in non-A= NSI
> - * mode -- there must be no spaces between its arguments, and for nes= ted
> - * __CONCAT's, all the __CONCAT's must be at the left.=C2=A0 = __CONCAT can also
> - * concatenate double-quoted strings produced by the __STRING macro, = but
> - * this only works with ANSI C.
>=C2=A0 =C2=A0 *
>=C2=A0 =C2=A0 * __XSTRING is like __STRING, but it expands any macros i= n its argument
> - * first.=C2=A0 It is only available with ANSI C.
> + * first.
>=C2=A0 =C2=A0 */
>=C2=A0 =C2=A0#if defined(__STDC__) || defined(__cplusplus)
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__P(protos)=C2=A0 =C2=A0 =C2=A0= protos=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* full-blown ANSI C */
> @@ -122,33 +117,7 @@
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__inline=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* delete GC= C keyword */
>=C2=A0 =C2=A0#endif /* ! __CC_SUPPORTS___INLINE */
>=C2=A0 =C2=A0#endif /* !__cplusplus */
> -
> -#else=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* !(__STDC__ || __cplusplus) */
> -#define=C2=A0 =C2=A0 =C2=A0 __P(protos)=C2=A0 =C2=A0 =C2=A0()=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* traditional C preprocessor */<= br> > -#define=C2=A0 =C2=A0 =C2=A0 __CONCAT(x,y)=C2=A0 =C2=A0x/**/y
> -#define=C2=A0 =C2=A0 =C2=A0 __STRING(x)=C2=A0 =C2=A0 =C2=A0"x&qu= ot;
> -
> -#if !defined(__CC_SUPPORTS___INLINE)
> -#define=C2=A0 =C2=A0 =C2=A0 __const=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/* delete pseudo-AN= SI C keywords */
> -#define=C2=A0 =C2=A0 =C2=A0 __inline
> -#define=C2=A0 =C2=A0 =C2=A0 __signed
> -#define=C2=A0 =C2=A0 =C2=A0 __volatile
> -/*
> - * In non-ANSI C environments, new programs will want ANSI-only C key= words
> - * deleted from the program and old programs will want them left alon= e.
> - * When using a compiler other than gcc, programs using the ANSI C ke= ywords
> - * const, inline etc. as normal identifiers should define -DNO_ANSI_K= EYWORDS.
> - * When using "gcc -traditional", we assume that this is th= e intent; if
> - * __GNUC__ is defined but __STDC__ is not, we leave the new keywords= alone.
> - */
> -#ifndef=C2=A0 =C2=A0 =C2=A0 NO_ANSI_KEYWORDS
> -#define=C2=A0 =C2=A0 =C2=A0 const=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/* delete ANS= I C keywords */
> -#define=C2=A0 =C2=A0 =C2=A0 inline
> -#define=C2=A0 =C2=A0 =C2=A0 signed
> -#define=C2=A0 =C2=A0 =C2=A0 volatile
> -#endif=C2=A0 =C2=A0 =C2=A0 =C2=A0/* !NO_ANSI_KEYWORDS */
> -#endif=C2=A0 =C2=A0 =C2=A0 =C2=A0/* !__CC_SUPPORTS___INLINE */
> -#endif=C2=A0 =C2=A0 =C2=A0 =C2=A0/* !(__STDC__ || __cplusplus) */
> +#endif=C2=A0 =C2=A0 =C2=A0 =C2=A0/* __STDC__ || __cplusplus */
>=C2=A0 =C2=A0
>=C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 * Compiler-dependent macros to help declare dead (non-ret= urning) and
> @@ -343,11 +312,6 @@
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__unreachable() ((void)0)
>=C2=A0 =C2=A0#endif
>=C2=A0 =C2=A0
> -/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
> -#if !__GNUC_PREREQ__(2, 7)
> -#define=C2=A0 =C2=A0 =C2=A0 __func__=C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL<= br> > -#endif
> -
>=C2=A0 =C2=A0#if (defined(__GNUC__) && __GNUC__ >=3D 2) &= ;& !defined(__STRICT_ANSI__) || __STDC_VERSION__ >=3D 199901
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__LONG_LONG_SUPPORTED
>=C2=A0 =C2=A0#endif

This removed a lot more than just __func__?

=
Damn. It looks like future work got folded in here by accident...=C2= =A0 This is the 'remove support for
pure K&R compilers= 9; stuff I've talked about elsewhere. I'll revert and fix.

--000000000000e2515f060b264230--