Bug 268814 - www/varnish7: fix build with clang 15
Summary: www/varnish7: fix build with clang 15
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2023-01-07 15:31 UTC by Dimitry Andric
Modified: 2023-01-08 11:31 UTC (History)
2 users (show)

See Also:
dbaio: maintainer-feedback+


Attachments
www/varnish7: fix build with clang 15 (1.04 KB, patch)
2023-01-07 15:31 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-01-07 15:31:01 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that www/varnish7 failed to build with clang 15:

  adler32.c:189:15: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
  uLong ZEXPORT adler32(adler, buf, len)
                ^

This is because varnish needlessly builds with -Werror. Turn it off, so the warnings can simply be ignored.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-01-07 15:31:26 UTC
Created attachment 239332 [details]
www/varnish7: fix build with clang 15
Comment 2 Danilo G. Baio freebsd_committer freebsd_triage 2023-01-07 18:45:02 UTC
Hi.

It's okay for me.

Please add a comment so we can re-check that when upgrading the port.

# Needed for clang 15 (#268814)

And thanks for your work.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2023-01-07 18:50:33 UTC
(In reply to Danilo G. Baio from comment #2)
Sure.

Note that the warnings are produced by the embedded copy of libz in varnish, which is very old K&R code. Ideally the varnish people should add some additional flags in their Makefile for this sub-library, to suppress any warnings there. Because that code will never be warning-free.
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-01-08 11:02:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=986c668ac668d0719592669141a9e1324af6b28f

commit 986c668ac668d0719592669141a9e1324af6b28f
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-01-07 15:26:06 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-01-08 11:01:11 +0000

    www/varnish7: fix build with clang 15

    During an exp-run for llvm 15 (see bug 265425), it turned out that
    www/varnish7 failed to build with clang 15:

      adler32.c:189:15: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
      uLong ZEXPORT adler32(adler, buf, len)
                    ^

    This is because varnish needlessly builds with -Werror. Turn it off, so
    the warnings can simply be ignored.

    PR:             268814
    Approved by:    dbaio (maintainer)
    MFH:            2023Q1

 www/varnish7/Makefile | 2 ++
 1 file changed, 2 insertions(+)