Bug 268301 - x11-toolkits/pangox-compat: fix build with clang 15
Summary: x11-toolkits/pangox-compat: 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-10 16:37 UTC by Dimitry Andric
Modified: 2022-12-12 15:20 UTC (History)
1 user (show)

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


Attachments
x11-toolkits/pangox-compat: fix build with clang 15 (1.81 KB, patch)
2022-12-10 16:37 UTC, Dimitry Andric
fluffy: maintainer-approval+
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-10 16:37:05 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that x11-toolkits/pangox-compat failed to build with clang 15:

  pangox.c:983:15: error: incompatible integer to pointer conversion assigning to 'PangoFontMetrics *' (aka 'struct _PangoFontMetrics *') from 'int' [-Wint-conversion]
        metrics = pango_font_metrics_new ();
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  pangox-fontmap.c:944:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
    char *files_str = pango_config_key_get ("PangoX/AliasFiles");
          ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is because pangox-compat uses two private functions from the main pango library, which are not declared in the public pango headers.

Fix the errors by adding the two private functions in pango-impl-utils.h, copying the declarations from pango-font-private.h and pango-utils-private.h.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-10 16:37:26 UTC
Created attachment 238694 [details]
x11-toolkits/pangox-compat: fix build with clang 15
Comment 2 Dima Panov freebsd_committer freebsd_triage 2022-12-10 16:40:23 UTC
Comment on attachment 238694 [details]
x11-toolkits/pangox-compat: fix build with clang 15

Ship it!
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-12-12 15:18:36 UTC
A commit in branch main references this bug:

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

commit c7823054d431d2e7a0ff064b8c40d51b97156220
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-10 16:30:35 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-12 15:17:02 +0000

    x11-toolkits/pangox-compat: fix build with clang 15

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

      pangox.c:983:15: error: incompatible integer to pointer conversion assigning to 'PangoFontMetrics *' (aka 'struct _PangoFontMetrics *') from 'int' [-Wint-conversion]
            metrics = pango_font_metrics_new ();
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
      pangox-fontmap.c:944:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
        char *files_str = pango_config_key_get ("PangoX/AliasFiles");
              ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    This is because pangox-compat uses two private functions from the main
    pango library, which are not declared in the public pango headers.

    Fix the errors by adding the two private functions in
    pango-impl-utils.h, copying the declarations from pango-font-private.h
    and pango-utils-private.h.

    PR:             268301
    Approved by:    fluffy (maintainer)
    MFH:            2022Q4

 .../pangox-compat/files/patch-pango-impl-utils.h (new)     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)