Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Dec 2023 12:32:48 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        Antoine Brodin <antoine@freebsd.org>, Gleb Smirnoff <glebius@freebsd.org>,  Richard Scheffenegger <rscheff@freebsd.org>, src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>,  "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: a8b70cf26030 - main - netpfil: Use accessor functions and named constants for all tcphdr flags
Message-ID:  <CANCZdfqgptdx7OzgbCyozvvPLBeA0MxDwFQUW6R=oSP_QPHunQ@mail.gmail.com>
In-Reply-To: <0452FE2C-00E9-4E06-880B-6F7B56751728@FreeBSD.org>
References:  <202312270143.3BR1hMQf085312@gitrepo.freebsd.org> <CAALwa8n%2BSs397icBLsYEPZM0ynnou=1Kxc5dV5FAa_CofjpT4A@mail.gmail.com> <ZY34hIExot089sPR@FreeBSD.org> <CAALwa8nf3x6ipG3hBv%2B3j0cHyYq%2BiGUjeMOW1qip%2BNMAXaZL%2Bw@mail.gmail.com> <24134FF7-8C03-490D-A476-4EFF4EAD8132@FreeBSD.org> <0452FE2C-00E9-4E06-880B-6F7B56751728@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Fri, Dec 29, 2023, 4:39 AM Dimitry Andric <dim@freebsd.org> wrote:

> On 29 Dec 2023, at 11:17, Dimitry Andric <dim@FreeBSD.org> wrote:
> >
> > On 29 Dec 2023, at 08:35, Antoine Brodin <antoine@FreeBSD.org> wrote:
> >>
> >> On Thu, Dec 28, 2023 at 10:37 PM Gleb Smirnoff <glebius@freebsd.org>
> wrote:
> >>>
> >>> Antoine,
> >>>
> >>> On Thu, Dec 28, 2023 at 08:48:36PM +0000, Antoine Brodin wrote:
> >>> A> >     netpfil: Use accessor functions and named constants for all
> tcphdr flags
> >>> A> >
> >>> ...
> >>> A> This breaks some ports:
> >>> A> /usr/include/netinet/tcp.h:82:8: error: unknown type name 'inline'
> >>>
> >>> Definitely some ports that use some strange compilers :)
> >>>
> >>> Can you please give at least port names?
> >>
> >> Some examples:
> >>
> >>
> https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/errors/nspr-4.35.log
> >>
> https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/errors/opusfile-0.12_1.log
> >
> > The culprit is likely the "-ansi" option. Just get rid of that, it is
> not really useful:
> >
> > cc -o prmapopt.o -c -fvisibility=hidden -O2 -pipe
> -fstack-protector-strong -fno-strict-aliasing -ansi -Wall -fPIC -UDEBUG
> -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
> -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"
> -DNDEBUG=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -DHAVE_VISIBILITY_PRAGMA=1
> -DXP_UNIX=1 -DFREEBSD=1 -DHAVE_BSD_FLOCK=1 -DHAVE_SOCKLEN_T=1
> -DHAVE_POINTER_LOCALTIME_R=1 -DHAVE_DLADDR=1 -DHAVE_LCHOWN=1
> -DHAVE_SETPRIORITY=1 -DHAVE_STRERROR=1 -DHAVE_SYSCALL=1
> -DHAVE_SECURE_GETENV=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DFORCE_PR_LOG
> -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_
> -I../../../dist/include/nspr -I../../../pr/include
> -I../../../pr/include/private prmapopt.c
> > In file included from prmapopt.c:46:
> > In file included from prmapopt.c:46:
> > /usr/include/netinet/tcp.h:82:8: error: unknown type name 'inline'
> >   82 | static inline uint16_t
> >      |        ^
>
> Hm, I may have spoken too soon here. If this port has always compiled
> successfully with -ansi, then indeed it may not be that handy to directly
> use the 'inline' keyword in system headers. I think most other system
> headers use '__inline', which is supported by both gcc and clang, even in
> ANSI mode. And if the compiler somehow does not support __inline,
> sys/cdefs.h can make sure all those keywords get removed.
>

Yes. You have to use __inline in system headers.

Warner


-Dimitry
>
>

[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 29, 2023, 4:39 AM Dimitry Andric &lt;<a href="mailto:dim@freebsd.org">dim@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 29 Dec 2023, at 11:17, Dimitry Andric &lt;dim@FreeBSD.org&gt; wrote:<br>
&gt; <br>
&gt; On 29 Dec 2023, at 08:35, Antoine Brodin &lt;antoine@FreeBSD.org&gt; wrote:<br>
&gt;&gt; <br>
&gt;&gt; On Thu, Dec 28, 2023 at 10:37 PM Gleb Smirnoff &lt;<a href="mailto:glebius@freebsd.org" target="_blank" rel="noreferrer">glebius@freebsd.org</a>&gt; wrote:<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Antoine,<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; On Thu, Dec 28, 2023 at 08:48:36PM +0000, Antoine Brodin wrote:<br>
&gt;&gt;&gt; A&gt; &gt;     netpfil: Use accessor functions and named constants for all tcphdr flags<br>
&gt;&gt;&gt; A&gt; &gt;<br>
&gt;&gt;&gt; ...<br>
&gt;&gt;&gt; A&gt; This breaks some ports:<br>
&gt;&gt;&gt; A&gt; /usr/include/netinet/tcp.h:82:8: error: unknown type name &#39;inline&#39;<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Definitely some ports that use some strange compilers :)<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Can you please give at least port names?<br>
&gt;&gt; <br>
&gt;&gt; Some examples:<br>
&gt;&gt; <br>
&gt;&gt; <a href="https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/errors/nspr-4.35.log" rel="noreferrer noreferrer" target="_blank">https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/errors/nspr-4.35.log</a><br>;
&gt;&gt; <a href="https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/errors/opusfile-0.12_1.log" rel="noreferrer noreferrer" target="_blank">https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/errors/opusfile-0.12_1.log</a><br>;
&gt; <br>
&gt; The culprit is likely the &quot;-ansi&quot; option. Just get rid of that, it is not really useful:<br>
&gt; <br>
&gt; cc -o prmapopt.o -c -fvisibility=hidden -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -ansi -Wall -fPIC -UDEBUG -DPACKAGE_NAME=\&quot;\&quot; -DPACKAGE_TARNAME=\&quot;\&quot; -DPACKAGE_VERSION=\&quot;\&quot; -DPACKAGE_STRING=\&quot;\&quot; -DPACKAGE_BUGREPORT=\&quot;\&quot; -DPACKAGE_URL=\&quot;\&quot; -DNDEBUG=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -DHAVE_VISIBILITY_PRAGMA=1 -DXP_UNIX=1 -DFREEBSD=1 -DHAVE_BSD_FLOCK=1 -DHAVE_SOCKLEN_T=1 -DHAVE_POINTER_LOCALTIME_R=1 -DHAVE_DLADDR=1 -DHAVE_LCHOWN=1 -DHAVE_SETPRIORITY=1 -DHAVE_STRERROR=1 -DHAVE_SYSCALL=1 -DHAVE_SECURE_GETENV=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I../../../dist/include/nspr -I../../../pr/include -I../../../pr/include/private prmapopt.c<br>
&gt; In file included from prmapopt.c:46:<br>
&gt; In file included from prmapopt.c:46:<br>
&gt; /usr/include/netinet/tcp.h:82:8: error: unknown type name &#39;inline&#39;<br>
&gt;   82 | static inline uint16_t<br>
&gt;      |        ^<br>
<br>
Hm, I may have spoken too soon here. If this port has always compiled successfully with -ansi, then indeed it may not be that handy to directly use the &#39;inline&#39; keyword in system headers. I think most other system headers use &#39;__inline&#39;, which is supported by both gcc and clang, even in ANSI mode. And if the compiler somehow does not support __inline, sys/cdefs.h can make sure all those keywords get removed.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes. You have to use __inline in system headers.</div><div dir="auto"><br></div><div dir="auto">Warner </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Dimitry<br>
<br>
</blockquote></div></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqgptdx7OzgbCyozvvPLBeA0MxDwFQUW6R=oSP_QPHunQ>