Re: git: eca005d8531f - main - zlib: silence K&R warns

From: Warner Losh <imp_at_bsdimp.com>
Date: Mon, 13 Feb 2023 01:52:47 UTC
On Sun, Feb 12, 2023 at 3:12 PM Mateusz Guzik <mjguzik@gmail.com> wrote:

> On 2/12/23, Warner Losh <imp@bsdimp.com> wrote:
> > On Sun, Feb 12, 2023 at 2:54 PM Mateusz Guzik <mjguzik@gmail.com> wrote:
> >
> >> On 2/12/23, Warner Losh <imp@bsdimp.com> wrote:
> >> > On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik <mjguzik@gmail.com>
> >> > wrote:
> >> >
> >> >> On 2/12/23, Jessica Clarke <jrtc27@freebsd.org> wrote:
> >> >> > On 12 Feb 2023, at 21:23, Mateusz Guzik <mjguzik@gmail.com> wrote:
> >> >> >>
> >> >> >> On 2/12/23, Jessica Clarke <jrtc27@freebsd.org> wrote:
> >> >> >>> On 12 Feb 2023, at 21:13, Mateusz Guzik <mjg@FreeBSD.org> wrote:
> >> >> >>>>
> >> >> >>>> The branch main has been updated by mjg:
> >> >> >>>>
> >> >> >>>> URL:
> >> >> >>>>
> >> >>
> >>
> https://cgit.FreeBSD.org/src/commit/?id=eca005d8531fd153f46f941f3101e73cdf181a0b
> >> >> >>>>
> >> >> >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b
> >> >> >>>> Author:     Mateusz Guzik <mjg@FreeBSD.org>
> >> >> >>>> AuthorDate: 2023-02-12 21:12:34 +0000
> >> >> >>>> Commit:     Mateusz Guzik <mjg@FreeBSD.org>
> >> >> >>>> CommitDate: 2023-02-12 21:12:34 +0000
> >> >> >>>>
> >> >> >>>>   zlib: silence K&R warns
> >> >> >>>>
> >> >> >>>>   Sponsored by:   Rubicon Communications, LLC ("Netgate")
> >> >> >>>> ---
> >> >> >>>> sys/conf/files            | 18 +++++++++++-------
> >> >> >>>> sys/modules/zlib/Makefile |  2 ++
> >> >> >>>> 2 files changed, 13 insertions(+), 7 deletions(-)
> >> >> >>>>
> >> >> >>>> diff --git a/sys/conf/files b/sys/conf/files
> >> >> >>>> index 9171b434a7bf..53f90f7afc22 100644
> >> >> >>>> --- a/sys/conf/files
> >> >> >>>> +++ b/sys/conf/files
> >> >> >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c          standard
> >> >> >>>> libkern/strvalid.c         standard
> >> >> >>>> libkern/timingsafe_bcmp.c  standard
> >> >> >>>> contrib/zlib/adler32.c             optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>> -  mxge | ddb_ctf | gzio | zfs | zlib
> >> >> >>>> +  mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>> +  compile-with "${NORMAL_C} -Wno-deprecated-non-prototype"
> >> >> >>>
> >> >> >>> This doesn’t exist pre-Clang 15.
> >> >> >>>
> >> >> >>
> >> >> >> this is main-only and it already has llvm15. the build requirement
> >> >> >> is
> >> >> >> top of the branch, so I don't see a problem.
> >> >> >>
> >> >> >> if you ran into trouble cross-compiling, you should probably
> update
> >> >> >> that env instead of expecting working around the warn in the tree
> >> >> >> for
> >> >> >> older compilers
> >> >> >
> >> >> > That is not our policy. Please fix this.
> >> >> >
> >> >>
> >> >> Are you sure about that? I distinctly recall the supported path to
> get
> >> >> top of the latest stable branch first, from there you should be able
> >> >> to build the toolchain and the kernel.
> >> >>
> >> >> afaics the above change did not affect it
> >> >>
> >> >> If you insist, I can look for the exact paragraph in the docs.
> >> >>
> >> >
> >> > The fix is trivial.
> >> >
> >> > https://reviews.freebsd.org/D38550
> >> >
> >> > Please focus your efforts on commenting on the above and testing it
> >> > out.
> >> >
> >>
> >> there is no warn with it
> >>
> >> but where is it stated that a compiler older than the newest in the
> >> tree is supported for kernel builds?
> >>
> >
> > As a project we've always benefitted from flexibility when it's trivial
> to
> > be flexible.
> >
>
> Look, I just want the build to be warn-free again and I don't care how
> zlib is handled for that purpose.
>
> I do note though that if "compiler flexibility" if you will is to be
> expected, it should be stated somewhere. Again, I only recall the
> opposite -- top of main needed to build the kernel.
>

% cd src
% find . -name Makefile\* -o -name \*.mk | xargs grep clang | wc
     760    2843   57563
% find . -name Makefile\* -o -name \*.mk | xargs grep gcc | wc
     337    1760   25053
% find . -name Makefile\* -o -name \*.mk | xargs grep COMPILER_VERSION | wc
      79     478    6061

over 1000 clang or gcc specific bits speaks for itself.

Warner

> > Warner
> >
> >
> >> >
> >> >
> >> >> > Jess
> >> >> >
> >> >> >>> Jess
> >> >> >>>
> >> >> >>>> contrib/zlib/compress.c            optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>>    mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>> -  compile-with "${NORMAL_C} -Wno-cast-qual"
> >> >> >>>> +  compile-with "${NORMAL_C} -Wno-cast-qual
> >> >> >>>> -Wno-deprecated-non-prototype"
> >> >> >>>> contrib/zlib/crc32.c               optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>>    mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>>    compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}"
> >> >> >>>> contrib/zlib/deflate.c             optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>>    mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>> -  compile-with "${NORMAL_C} -Wno-cast-qual"
> >> >> >>>> +  compile-with "${NORMAL_C} -Wno-cast-qual
> >> >> >>>> -Wno-deprecated-non-prototype"
> >> >> >>>> contrib/zlib/inffast.c             optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>> -  mxge | ddb_ctf | gzio | zfs | zlib
> >> >> >>>> +  mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>> +  compile-with "${NORMAL_C} -Wno-deprecated-non-prototype"
> >> >> >>>> contrib/zlib/inflate.c             optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>> -  mxge | ddb_ctf | gzio | zfs | zlib
> >> >> >>>> +  mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>> +  compile-with "${NORMAL_C} -Wno-deprecated-non-prototype"
> >> >> >>>> contrib/zlib/inftrees.c            optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>> -  mxge | ddb_ctf | gzio | zfs | zlib
> >> >> >>>> +  mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>> +  compile-with "${NORMAL_C} -Wno-deprecated-non-prototype"
> >> >> >>>> contrib/zlib/trees.c               optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>>    mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>>    compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}"
> >> >> >>>> contrib/zlib/uncompr.c             optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>>    mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>> -  compile-with "${NORMAL_C} -Wno-cast-qual"
> >> >> >>>> +  compile-with "${NORMAL_C} -Wno-cast-qual
> >> >> >>>> -Wno-deprecated-non-prototype"
> >> >> >>>> contrib/zlib/zutil.c               optional crypto | geom_uzip |
> >> >> >>>> \
> >> >> >>>>    mxge | ddb_ctf | gzio | zfs | zlib \
> >> >> >>>>    compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}"
> >> >> >>>> diff --git a/sys/modules/zlib/Makefile
> >> >> >>>> b/sys/modules/zlib/Makefile
> >> >> >>>> index 6391255e512b..178d3a3f7ab7 100644
> >> >> >>>> --- a/sys/modules/zlib/Makefile
> >> >> >>>> +++ b/sys/modules/zlib/Makefile
> >> >> >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=${NO_WSTRICT_PROTOTYPES} #
> >> >> >>>> crc32.c:586
> >> >> >>>> CWARNFLAGS.trees.c+=${NO_WSTRICT_PROTOTYPES} # trees.c:232
> >> >> >>>> CWARNFLAGS.zutil.c+=${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32
> >> >> >>>>
> >> >> >>>> +CWARNFLAGS+=-Wno-deprecated-non-prototype
> >> >> >>>> +
> >> >> >>>> .include <bsd.kmod.mk>
> >> >> >>>
> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> Mateusz Guzik <mjguzik gmail.com>
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >> Mateusz Guzik <mjguzik gmail.com>
> >> >>
> >> >
> >>
> >>
> >> --
> >> Mateusz Guzik <mjguzik gmail.com>
> >>
> >
>
>
> --
> Mateusz Guzik <mjguzik gmail.com>
>