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
--00000000000091b2ef060dab19d3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 29, 2023, 4:39=E2=80=AFAM Dimitry Andric <dim@freebsd.org> wrot= e: > 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=E2=80=AFPM Gleb Smirnoff <glebius@freebs= d.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=3Dhidden -O2 -pipe > -fstack-protector-strong -fno-strict-aliasing -ansi -Wall -fPIC -UDEBUG > -DPACKAGE_NAME=3D\"\" -DPACKAGE_TARNAME=3D\"\" -DPACKAGE_VERSION=3D\"\" > -DPACKAGE_STRING=3D\"\" -DPACKAGE_BUGREPORT=3D\"\" -DPACKAGE_URL=3D\"\" > -DNDEBUG=3D1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=3D1 -DHAVE_VISIBILITY_PRA= GMA=3D1 > -DXP_UNIX=3D1 -DFREEBSD=3D1 -DHAVE_BSD_FLOCK=3D1 -DHAVE_SOCKLEN_T=3D1 > -DHAVE_POINTER_LOCALTIME_R=3D1 -DHAVE_DLADDR=3D1 -DHAVE_LCHOWN=3D1 > -DHAVE_SETPRIORITY=3D1 -DHAVE_STRERROR=3D1 -DHAVE_SYSCALL=3D1 > -DHAVE_SECURE_GETENV=3D1 -D_REENTRANT=3D1 -D_THREAD_SAFE=3D1 -DFORCE_PR_L= OG > -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 > > --00000000000091b2ef060dab19d3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">On Fri, Dec 29, 2023, 4:39=E2=80=AFAM Dimitry Andric &= lt;<a href=3D"mailto:dim@freebsd.org">dim@freebsd.org</a>> wrote:<br></d= iv><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left= :1px #ccc solid;padding-left:1ex">On 29 Dec 2023, at 11:17, Dimitry Andric = <dim@FreeBSD.org> wrote:<br> > <br> > On 29 Dec 2023, at 08:35, Antoine Brodin <antoine@FreeBSD.org> w= rote:<br> >> <br> >> On Thu, Dec 28, 2023 at 10:37=E2=80=AFPM Gleb Smirnoff <<a href= =3D"mailto:glebius@freebsd.org" target=3D"_blank" rel=3D"noreferrer">glebiu= s@freebsd.org</a>> wrote:<br> >>> <br> >>> Antoine,<br> >>> <br> >>> On Thu, Dec 28, 2023 at 08:48:36PM +0000, Antoine Brodin wrote= :<br> >>> A> >=C2=A0 =C2=A0 =C2=A0netpfil: Use accessor functions = and named constants for all tcphdr flags<br> >>> A> ><br> >>> ...<br> >>> A> This breaks some ports:<br> >>> A> /usr/include/netinet/tcp.h:82:8: error: unknown type nam= e 'inline'<br> >>> <br> >>> Definitely some ports that use some strange compilers :)<br> >>> <br> >>> Can you please give at least port names?<br> >> <br> >> Some examples:<br> >> <br> >> <a href=3D"https://pkg-status.freebsd.org/gohan04/data/mainamd64PR= 275986-default-foo/2023-12-28_20h35m41s/logs/errors/nspr-4.35.log" rel=3D"n= oreferrer noreferrer" target=3D"_blank">https://pkg-status.freebsd.org/goha= n04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/errors/nsp= r-4.35.log</a><br> >> <a href=3D"https://pkg-status.freebsd.org/gohan04/data/mainamd64PR= 275986-default-foo/2023-12-28_20h35m41s/logs/errors/opusfile-0.12_1.log" re= l=3D"noreferrer noreferrer" target=3D"_blank">https://pkg-status.freebsd.or= g/gohan04/data/mainamd64PR275986-default-foo/2023-12-28_20h35m41s/logs/erro= rs/opusfile-0.12_1.log</a><br> > <br> > The culprit is likely the "-ansi" option. Just get rid of th= at, it is not really useful:<br> > <br> > cc -o prmapopt.o -c -fvisibility=3Dhidden -O2 -pipe -fstack-protector-= strong -fno-strict-aliasing -ansi -Wall -fPIC -UDEBUG -DPACKAGE_NAME=3D\&qu= ot;\" -DPACKAGE_TARNAME=3D\"\" -DPACKAGE_VERSION=3D\"\&= quot; -DPACKAGE_STRING=3D\"\" -DPACKAGE_BUGREPORT=3D\"\"= ; -DPACKAGE_URL=3D\"\" -DNDEBUG=3D1 -DHAVE_VISIBILITY_HIDDEN_ATTR= IBUTE=3D1 -DHAVE_VISIBILITY_PRAGMA=3D1 -DXP_UNIX=3D1 -DFREEBSD=3D1 -DHAVE_B= SD_FLOCK=3D1 -DHAVE_SOCKLEN_T=3D1 -DHAVE_POINTER_LOCALTIME_R=3D1 -DHAVE_DLA= DDR=3D1 -DHAVE_LCHOWN=3D1 -DHAVE_SETPRIORITY=3D1 -DHAVE_STRERROR=3D1 -DHAVE= _SYSCALL=3D1 -DHAVE_SECURE_GETENV=3D1 -D_REENTRANT=3D1 -D_THREAD_SAFE=3D1 -= 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> > In file included from prmapopt.c:46:<br> > In file included from prmapopt.c:46:<br> > /usr/include/netinet/tcp.h:82:8: error: unknown type name 'inline&= #39;<br> >=C2=A0 =C2=A082 | static inline uint16_t<br> >=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 ^<br> <br> Hm, I may have spoken too soon here. If this port has always compiled succe= ssfully with -ansi, then indeed it may not be that handy to directly use th= e 'inline' keyword in system headers. I think most other system hea= ders use '__inline', which is supported by both gcc and clang, even= in ANSI mode. And if the compiler somehow does not support __inline, sys/c= defs.h can make sure all those keywords get removed.<br></blockquote></div>= </div><div dir=3D"auto"><br></div><div dir=3D"auto">Yes. You have to use __= inline in system headers.</div><div dir=3D"auto"><br></div><div dir=3D"auto= ">Warner=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div= ><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_qu= ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex= "> -Dimitry<br> <br> </blockquote></div></div></div> --00000000000091b2ef060dab19d3--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqgptdx7OzgbCyozvvPLBeA0MxDwFQUW6R=oSP_QPHunQ>