Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2023 11:12:19 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: b88ca6ee167d - main - cdefs: Remove CC_SUPPORTS macros, they are unused
Message-ID:  <CANCZdfprwpJBV2-erLhX2ZFSTmkhGp-=4qnLrdEEtLTrw4DGRQ@mail.gmail.com>
In-Reply-To: <8d51e8f9-37a0-4f28-bf05-2a58514fddb0@FreeBSD.org>
References:  <202311270525.3AR5PHQ2067285@gitrepo.freebsd.org> <8d51e8f9-37a0-4f28-bf05-2a58514fddb0@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000cfa970060b263e79
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 <jhb@freebsd.org> 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=3Db88ca6ee167d079c965dfe123bbe296=
d3a945c0a
> >
> > commit b88ca6ee167d079c965dfe123bbe296d3a945c0a
> > Author:     Warner Losh <imp@FreeBSD.org>
> > AuthorDate: 2023-11-20 22:40:55 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2023-11-27 05:24:02 +0000
> >
> >      cdefs: Remove CC_SUPPORTS macros, they are unused
> >
> >      Remove __CC_SUPPORTS_INLINE, __CC_SUPPORTS___INLINE__,
> >      __CC_SUPPORTS___FUNC__, __CC_SUPPORTS_WARNING,
> >      __CC_SUPPORTS_VARADIC_XXX, __CC_SUPPORTS_DYNAMIC_ARRAY_INIT: they
> are
> >      unused. Also remove them from the generated cryptodevh.py script.
> >
> >      Retain, for the moment, __CC_SUPPORTS___INLINE, since it's used in
> this
> >      file.
> >
> >      PR: 275221 (exp-run)
> >      Sponsored by:           Netflix
> > ---
> >   sys/sys/cdefs.h                    | 10 ----------
> >   tests/sys/opencrypto/cryptodevh.py |  7 -------
> >   2 files changed, 17 deletions(-)
> >
> > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
> > index 5782735187c5..7f3efc9300c9 100644
> > --- a/sys/sys/cdefs.h
> > +++ b/sys/sys/cdefs.h
> > @@ -79,17 +79,7 @@
> >    */
> >   #define     __compiler_membar()     __asm __volatile(" " : : :
> "memory")
> >
> > -/* XXX: if __GNUC__ >=3D 2: not tested everywhere originally, where
> replaced */
> > -#define      __CC_SUPPORTS_INLINE 1
> >   #define     __CC_SUPPORTS___INLINE 1
> > -#define      __CC_SUPPORTS___INLINE__ 1
> > -
> > -#define      __CC_SUPPORTS___FUNC__ 1
> > -#define      __CC_SUPPORTS_WARNING 1
> > -
> > -#define      __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */
> > -
> > -#define      __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1
> >
> >   #endif /* __GNUC__ */
> >
> > diff --git a/tests/sys/opencrypto/cryptodevh.py
> b/tests/sys/opencrypto/cryptodevh.py
> > index d6982c26f1cf..9607bcd4d115 100644
> > --- a/tests/sys/opencrypto/cryptodevh.py
> > +++ b/tests/sys/opencrypto/cryptodevh.py
> > @@ -23,13 +23,6 @@ def __has_include(x): return 0
> >
> >   def __has_builtin(x): return 0
> >
> > -__CC_SUPPORTS_INLINE =3D 1
> > -__CC_SUPPORTS___INLINE =3D 1
> > -__CC_SUPPORTS___INLINE__ =3D 1
> > -__CC_SUPPORTS___FUNC__ =3D 1
> > -__CC_SUPPORTS_WARNING =3D 1
> > -__CC_SUPPORTS_VARADIC_XXX =3D 1
> > -__CC_SUPPORTS_DYNAMIC_ARRAY_INIT =3D 1
> >   def __P(protos): return protos
> >
> >   def __STRING(x): return #x
>
> It doesn't really matter, but you accidentally removed
> __CC_SUPPORTS___INLINE from
> the python version but not cdefs.h.  I wonder how hard it would be to jus=
t
> regenerate
> cryptodevh.py rather than updating it manually as I'm sure it is missing
> some other
> updates.
>

Yea, I'm not at all sure how it was generated in the first place.  And I
removed it there when
I removed it in cdefs.h, but then I failed to add it back when I concluded
that I had to add
it back to cdefs.h....  I think I have plans to remove it in 2024q1 cdefs.h
cleaning where I'll
go farther: kill K&R support macros we have in there (so one couldn't use a
pure K&R compiler
on FreeBSD with the system headers... though doing that is already
impossible because of
all the prototypes). I also plan on eliminating all support for gcc prior
to 4.2. There's only one
port in the tree that uses an older gcc (2.8 for hp48x cross compiler) and
it's i386 only. And I've
not installed it to see if it uses the system headers or not (if it
doesn't, then my changes won't
affect it at all). I also have tcc (aka tinyc) working after a fashion
(I've fixed the compile issues
we have with it) just to make sure my future cleanups don't break other
compilers (though this
is the only other one I know works and uses system headers).

Warner

--000000000000cfa970060b263e79
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Nov 27, 2023 at 10:50=E2=80=
=AFAM John Baldwin &lt;<a href=3D"mailto:jhb@freebsd.org">jhb@freebsd.org</=
a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On=
 11/26/23 9:25 PM, Warner Losh wrote:<br>
&gt; The branch main has been updated by imp:<br>
&gt; <br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3Db88ca6ee167d=
079c965dfe123bbe296d3a945c0a" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3Db88ca6ee167d079c965dfe123bbe296d3a945c0a<=
/a><br>
&gt; <br>
&gt; commit b88ca6ee167d079c965dfe123bbe296d3a945c0a<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2023-11-20 22:40:55 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; CommitDate: 2023-11-27 05:24:02 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 cdefs: Remove CC_SUPPORTS macros, they are unused<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Remove __CC_SUPPORTS_INLINE, __CC_SUPPORTS___INLIN=
E__,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS___FUNC__, __CC_SUPPORTS_WARNING,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS_VARADIC_XXX, __CC_SUPPORTS_DYNAMIC_A=
RRAY_INIT: they are<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unused. Also remove them from the generated crypto=
devh.py script.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Retain, for the moment, __CC_SUPPORTS___INLINE, si=
nce it&#39;s used in this<br>
&gt;=C2=A0 =C2=A0 =C2=A0 file.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 PR: 275221 (exp-run)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0Netflix<br>
&gt; ---<br>
&gt;=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 | 10 ----------<br>
&gt;=C2=A0 =C2=A0tests/sys/opencrypto/cryptodevh.py |=C2=A0 7 -------<br>
&gt;=C2=A0 =C2=A02 files changed, 17 deletions(-)<br>
&gt; <br>
&gt; diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h<br>
&gt; index 5782735187c5..7f3efc9300c9 100644<br>
&gt; --- a/sys/sys/cdefs.h<br>
&gt; +++ b/sys/sys/cdefs.h<br>
&gt; @@ -79,17 +79,7 @@<br>
&gt;=C2=A0 =C2=A0 */<br>
&gt;=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__compiler_membar()=C2=A0 =C2=
=A0 =C2=A0__asm __volatile(&quot; &quot; : : : &quot;memory&quot;)<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -/* XXX: if __GNUC__ &gt;=3D 2: not tested everywhere originally, wher=
e replaced */<br>
&gt; -#define=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS_INLINE 1<br>
&gt;=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__CC_SUPPORTS___INLINE 1<br>
&gt; -#define=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS___INLINE__ 1<br>
&gt; -<br>
&gt; -#define=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS___FUNC__ 1<br>
&gt; -#define=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS_WARNING 1<br>
&gt; -<br>
&gt; -#define=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS_VARADIC_XXX 1 /* see vararg=
s.h */<br>
&gt; -<br>
&gt; -#define=C2=A0 =C2=A0 =C2=A0 __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0#endif /* __GNUC__ */<br>
&gt;=C2=A0 =C2=A0<br>
&gt; diff --git a/tests/sys/opencrypto/cryptodevh.py b/tests/sys/opencrypto=
/cryptodevh.py<br>
&gt; index d6982c26f1cf..9607bcd4d115 100644<br>
&gt; --- a/tests/sys/opencrypto/cryptodevh.py<br>
&gt; +++ b/tests/sys/opencrypto/cryptodevh.py<br>
&gt; @@ -23,13 +23,6 @@ def __has_include(x): return 0<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0def __has_builtin(x): return 0<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -__CC_SUPPORTS_INLINE =3D 1<br>
&gt; -__CC_SUPPORTS___INLINE =3D 1<br>
&gt; -__CC_SUPPORTS___INLINE__ =3D 1<br>
&gt; -__CC_SUPPORTS___FUNC__ =3D 1<br>
&gt; -__CC_SUPPORTS_WARNING =3D 1<br>
&gt; -__CC_SUPPORTS_VARADIC_XXX =3D 1<br>
&gt; -__CC_SUPPORTS_DYNAMIC_ARRAY_INIT =3D 1<br>
&gt;=C2=A0 =C2=A0def __P(protos): return protos=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0def __STRING(x): return #x=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 <br>
<br>
It doesn&#39;t really matter, but you accidentally removed __CC_SUPPORTS___=
INLINE from<br>
the python version but not cdefs.h.=C2=A0 I wonder how hard it would be to =
just regenerate<br>
cryptodevh.py rather than updating it manually as I&#39;m sure it is missin=
g some other<br>
updates.<br></blockquote><div><br></div><div>Yea, I&#39;m not at all sure h=
ow it was generated in the first place.=C2=A0 And I removed it there when</=
div><div>I removed it in cdefs.h, but then I failed to add it back when I c=
oncluded that I had to add</div><div>it back to cdefs.h....=C2=A0 I think I=
 have plans to remove it in 2024q1 cdefs.h cleaning where I&#39;ll</div><di=
v>go farther: kill K&amp;R support macros we have in there (so one couldn&#=
39;t use a pure K&amp;R compiler</div><div>on FreeBSD with the system heade=
rs... though doing that is already impossible because of</div><div>all the =
prototypes). I also plan on eliminating all support for gcc prior to 4.2. T=
here&#39;s only one</div><div>port in the tree that uses an older gcc (2.8 =
for hp48x cross compiler) and it&#39;s i386 only. And I&#39;ve</div><div>no=
t installed it to see if it uses the system headers or not (if it doesn&#39=
;t, then my changes won&#39;t</div><div>affect it at all). I also have tcc =
(aka tinyc) working after a fashion (I&#39;ve fixed the compile issues</div=
><div>we have with it) just to make sure my future cleanups don&#39;t break=
 other compilers (though this</div><div>is the only other one I know works =
and uses system headers).</div><div><br></div><div>Warner</div></div></div>

--000000000000cfa970060b263e79--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfprwpJBV2-erLhX2ZFSTmkhGp-=4qnLrdEEtLTrw4DGRQ>