Bug 268209 - sysutils/pftop: fix build with clang 15
Summary: sysutils/pftop: 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: Michael Gmelin
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2022-12-06 21:14 UTC by Dimitry Andric
Modified: 2022-12-09 17:12 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (grembo)


Attachments
sysutils/pftop: fix build with clang 15 (1.23 KB, patch)
2022-12-06 21:14 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 2022-12-06 21:14:17 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that sysutils/pftop failed to build with clang 15:

    pftop.c:1656:28: error: incompatible pointer to integer conversion
    passing 'counter_u64_t' (aka 'unsigned long *') to parameter of type
    'u_int64_t' (aka 'unsigned long'); dereference with * [-Wint-conversion]
            print_fld_size(FLD_STATS, pr->states_tot);
                                      ^~~~~~~~~~~~~~
                                      *

Indeed, the states_tot field is a pointer, and must be derefenced first.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-06 21:14:42 UTC
Created attachment 238585 [details]
sysutils/pftop: fix build with clang 15
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2022-12-09 17:11:49 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-12-09 17:12:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=73084fa85ffdf454d0a1348d17a6e772c22e7b28

commit 73084fa85ffdf454d0a1348d17a6e772c22e7b28
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-09 17:02:29 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2022-12-09 17:06:53 +0000

    sysutils/pftop: Fix build with clang 15

    PR:             268209

 sysutils/pftop/Makefile                  | 1 +
 sysutils/pftop/files/extra-patch-pftop.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)