Bug 268260 - devel/libgtop: fix build with clang 15
Summary: devel/libgtop: 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: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2022-12-08 22:44 UTC by Dimitry Andric
Modified: 2022-12-10 08:36 UTC (History)
0 users

See Also:
jbeich: merge-quarterly+


Attachments
devel/libgtop: fix build with clang 15 (1.85 KB, patch)
2022-12-08 22:45 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-08 22:44:59 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that devel/libgtop failed to build with clang 15:

  main.c:226:35: error: incompatible pointer to integer conversion passing 'char[1024]' to parameter of type 'pid_t' (aka 'int') [-Wint-conversion]
                  (server, &resp->u.data.proc_io, parameter);
                                                  ^~~~~~~~~
  ../../include/glibtop/procio.h:78:74: note: passing argument to parameter 'pid' here
  void glibtop_get_proc_io_l (glibtop *server, glibtop_proc_io *buf, pid_t pid);
                                                                           ^

Indeed the parameter is supposed to be a pid_t, and upstream fixed this in <https://gitlab.gnome.org/GNOME/libgtop/-/commit/df6393ac>.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-08 22:45:15 UTC
Created attachment 238648 [details]
devel/libgtop: fix build with clang 15
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-12-10 08:34:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2fef1dbd478ea473588cc0f8ec4ff1b3654012a2

commit 2fef1dbd478ea473588cc0f8ec4ff1b3654012a2
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-08 22:41:12 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-12-10 08:30:12 +0000

    devel/libgtop: unbreak build with clang 15

    main.c:226:35: error: incompatible pointer to integer conversion passing 'char[1024]' to parameter of type 'pid_t' (aka 'int') [-Wint-conversion]
                    (server, &resp->u.data.proc_io, parameter);
                                                    ^~~~~~~~~
    ../../include/glibtop/procio.h:78:74: note: passing argument to parameter 'pid' here
    void glibtop_get_proc_io_l (glibtop *server, glibtop_proc_io *buf, pid_t pid);
                                                                             ^

    PR:             268260
    Reported by:    antoine (via bug 265425 exp-run)

 devel/libgtop/Makefile | 4 ++++
 devel/libgtop/distinfo | 2 ++
 2 files changed, 6 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-12-10 08:34:46 UTC
A commit in branch 2022Q4 references this bug:

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

commit b27b06ae72722527f8da7fea83387979cc68416e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-08 22:41:12 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-12-10 08:34:18 +0000

    devel/libgtop: unbreak build with clang 15

    main.c:226:35: error: incompatible pointer to integer conversion passing 'char[1024]' to parameter of type 'pid_t' (aka 'int') [-Wint-conversion]
                    (server, &resp->u.data.proc_io, parameter);
                                                    ^~~~~~~~~
    ../../include/glibtop/procio.h:78:74: note: passing argument to parameter 'pid' here
    void glibtop_get_proc_io_l (glibtop *server, glibtop_proc_io *buf, pid_t pid);
                                                                             ^

    PR:             268260
    Reported by:    antoine (via bug 265425 exp-run)

    (cherry picked from commit 2fef1dbd478ea473588cc0f8ec4ff1b3654012a2)

 devel/libgtop/Makefile | 4 ++++
 devel/libgtop/distinfo | 2 ++
 2 files changed, 6 insertions(+)
Comment 4 Jan Beich freebsd_committer freebsd_triage 2022-12-10 08:36:47 UTC
Thanks. Landed with cosmetic changes:
- dropped redundant bits from the commit message
- replaced files/patch-commit-* with PATCHFILES to denote "as is" (without rebase)
- bump PORTREVISION due to minor change in runtime behavior (memcpy)