Bug 271709 - x11-toolkits/pangox-compat: fix build with clang 16
Summary: x11-toolkits/pangox-compat: 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-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-29 16:45 UTC by Dimitry Andric
Modified: 2023-05-29 17:28 UTC (History)
1 user (show)

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


Attachments
x11-toolkits/pangox-compat: fix build with clang 16 (2.20 KB, patch)
2023-05-29 16:46 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 2023-05-29 16:45:42 UTC
Clang 16 has a new error about incompatible function types, which shows
up when building x11-toolkits/pangox-compat:

basic-x.c:687:23: error: incompatible function pointer types assigning to 'void (*)(PangoEngineShape *, PangoFont *, const char *, unsigned int, const PangoAnalysis *, PangoGlyphString *, const char *, unsigned int)' (aka 'void (*)(struct _PangoEngineShape *, struct _PangoFont *, const char *, unsigned int, const struct _PangoAnalysis *, struct _PangoGlyphString *, const char *, unsigned int)') from 'void (PangoEngineShape *, PangoFont *, const char *, gint, const PangoAnalysis *, PangoGlyphString *)' (aka 'void (struct _PangoEngineShape *, struct _PangoFont *, const char *, int, const struct _PangoAnalysis *, struct _PangoGlyphString *)') [-Wincompatible-function-pointer-types]
  class->script_shape = basic_engine_shape;
                      ^ ~~~~~~~~~~~~~~~~~~

This is because the 'script_shape' callback function in pango 1.50 has
the 'length' argument as 'unsigned int', and also two additional
parameters 'paragraph_text' and 'paragraph_length'. Even though it looks
like this callback function is never used, correct the arguments to fix
the error.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-29 16:46:02 UTC
Created attachment 242480 [details]
x11-toolkits/pangox-compat: fix build with clang 16
Comment 2 Dima Panov freebsd_committer freebsd_triage 2023-05-29 16:53:25 UTC
Comment on attachment 242480 [details]
x11-toolkits/pangox-compat: fix build with clang 16

Go ahead!
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-29 17:22:01 UTC
A commit in branch main references this bug:

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

commit 1f905384aff97cb61995ae241e77261bc109a865
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-29 16:44:45 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-29 17:20:12 +0000

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

    Clang 16 has a new error about incompatible function types, which shows
    up when building x11-toolkits/pangox-compat:

    basic-x.c:687:23: error: incompatible function pointer types assigning to 'void (*)(PangoEngineShape *, PangoFont *, const char *, unsigned int, const PangoAnalysis *, PangoGlyphString *, const char *, unsigned int)' (aka 'void (*)(struct _PangoEngineShape *, struct _PangoFont *, const char *, unsigned int, const struct _PangoAnalysis *, struct _PangoGlyphString *, const char *, unsigned int)') from 'void (PangoEngineShape *, PangoFont *, const char *, gint, const PangoAnalysis *, PangoGlyphString *)' (aka 'void (struct _PangoEngineShape *, struct _PangoFont *, const char *, int, const struct _PangoAnalysis *, struct _PangoGlyphString *)') [-Wincompatible-function-pointer-types]
      class->script_shape = basic_engine_shape;
                          ^ ~~~~~~~~~~~~~~~~~~

    This is because the 'script_shape' callback function in pango 1.50 has
    the 'length' argument as 'unsigned int', and also two additional
    parameters 'paragraph_text' and 'paragraph_length'. Even though it looks
    like this callback function is never used, correct the arguments to fix
    the error.

    PR:             271709
    Approved by:    fluffy (maintainer)
    MFH:            2023Q2

 x11-toolkits/pangox-compat/Makefile                    |  2 +-
 x11-toolkits/pangox-compat/files/patch-basic-x.c (new) | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)