Bug 271316 - textproc/augeas: fix build with clang 16
Summary: textproc/augeas: fix build with clang 16
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 Puppet Team
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-08 17:01 UTC by Dimitry Andric
Modified: 2023-05-18 11:43 UTC (History)
1 user (show)

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


Attachments
textproc/augeas: fix build with clang 16 (1.46 KB, patch)
2023-05-08 17:02 UTC, Dimitry Andric
no flags Details | Diff
textproc/augeas: fix build with clang 16 (2.13 KB, patch)
2023-05-10 18:01 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-05-08 17:01:53 UTC
Clang 16 has a new error about incompatible integer to pointer
conversions, which shows up when building textproc/augeas:

  augprint.c:1477:24: warning: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    char *program_name = basename(argv[0]);
                         ^
  augprint.c:1477:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
    char *program_name = basename(argv[0]);
          ^              ~~~~~~~~~~~~~~~~~

This is because basename(3) is declared in <libgen.h>, but augprint.c
does not include it. Add the include to fix the error.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-08 17:02:18 UTC
Created attachment 242062 [details]
textproc/augeas: fix build with clang 16
Comment 2 Mina Galić freebsd_triage 2023-05-08 21:11:15 UTC
I know your last pull request hasn't been merged upstream yet, but would you still try to submit this upstream?
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2023-05-08 22:23:15 UTC
(In reply to Mina Galić from comment #2)
Ah, I didn't check upstream but it's already fixed there:

https://github.com/hercules-team/augeas/pull/792
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2023-05-10 18:01:59 UTC
Created attachment 242108 [details]
textproc/augeas: fix build with clang 16

Update patch to apply the upstream fix instead.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-05-18 11:42:02 UTC
A commit in branch main references this bug:

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

commit 67237e5afd193f57fb2153072d01d6645eb79b5c
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-08 08:37:41 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-18 11:33:25 +0000

    textproc/augeas: fix build with clang 16

    Clang 16 has a new error about incompatible integer to pointer
    conversions, which shows up when building textproc/augeas:

      augprint.c:1477:24: warning: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        char *program_name = basename(argv[0]);
                             ^
      augprint.c:1477:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
        char *program_name = basename(argv[0]);
              ^              ~~~~~~~~~~~~~~~~~

    This is because basename(3) is declared in <libgen.h>, but augprint.c
    does not include it. Upstream has already fixed this, so apply the
    commit until there is a new release.

    PR:             271316
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q2

 textproc/augeas/Makefile | 4 ++++
 textproc/augeas/distinfo | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)