Bug 268209

Summary: sysutils/pftop: fix build with clang 15
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Michael Gmelin <grembo>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (grembo)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 265425    
Attachments:
Description Flags
sysutils/pftop: fix build with clang 15 none

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(-)