Bug 271531 - devel/py-ruamel.yaml.clib: fix build with clang 16
Summary: devel/py-ruamel.yaml.clib: 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: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-20 14:35 UTC by Dimitry Andric
Modified: 2024-02-01 09:21 UTC (History)
1 user (show)

See Also:
sunpoet: maintainer-feedback+


Attachments
devel/py-ruamel.yaml.clib: fix build with clang 16 (3.66 KB, patch)
2023-05-20 14:35 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-20 14:35:24 UTC
Clang 16 has a new error about incompatible function types, which shows
up when building devel/py-ruamel.yaml.clib:

  _ruamel_yaml.c:3590:52: error: incompatible function pointer types passing 'int (void *, char *, int, int *)' to parameter of type 'yaml_read_handler_t *' (aka 'int (*)(void *, unsigned char *, unsigned long, unsigned long *)') [-Wincompatible-function-pointer-types]
      yaml_parser_set_input((&__pyx_v_self->parser), __pyx_f_12_ruamel_yaml_input_handler, ((void *)__pyx_v_self));
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  _ruamel_yaml.c:15301:53: error: incompatible function pointer types passing 'int (void *, char *, int)' to parameter of type 'yaml_write_handler_t *' (aka 'int (*)(void *, unsigned char *, unsigned long)') [-Wincompatible-function-pointer-types]
    yaml_emitter_set_output((&__pyx_v_self->emitter), __pyx_f_12_ruamel_yaml_output_handler, ((void *)__pyx_v_self));
                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It seems that _ruamel_yaml.c was originally generated from a rather old
yaml.h interface header. I have looked upstream but it has not been
updated there either, so for now patch the function signatures to match
what is in our textproc/libyaml port.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-20 14:35:57 UTC
Created attachment 242294 [details]
devel/py-ruamel.yaml.clib: fix build with clang 16
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-05-22 15:20:03 UTC
LGTM. Please add the patch as patch-clang16. Thanks.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-23 14:16:28 UTC
A commit in branch main references this bug:

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

commit 98fd17ab866a916691388b5f6e801586329b9ba6
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-20 14:30:54 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-23 14:15:16 +0000

    devel/py-ruamel.yaml.clib: fix build with clang 16

    Clang 16 has a new error about incompatible function types, which shows
    up when building devel/py-ruamel.yaml.clib:

      _ruamel_yaml.c:3590:52: error: incompatible function pointer types passing 'int (void *, char *, int, int *)' to parameter of type 'yaml_read_handler_t *' (aka 'int (*)(void *, unsigned char *, unsigned long, unsigned long *)') [-Wincompatible-function-pointer-types]
          yaml_parser_set_input((&__pyx_v_self->parser), __pyx_f_12_ruamel_yaml_input_handler, ((void *)__pyx_v_self));
                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      _ruamel_yaml.c:15301:53: error: incompatible function pointer types passing 'int (void *, char *, int)' to parameter of type 'yaml_write_handler_t *' (aka 'int (*)(void *, unsigned char *, unsigned long)') [-Wincompatible-function-pointer-types]
        yaml_emitter_set_output((&__pyx_v_self->emitter), __pyx_f_12_ruamel_yaml_output_handler, ((void *)__pyx_v_self));
                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    It seems that _ruamel_yaml.c was originally generated from a rather old
    yaml.h interface header. I have looked upstream but it has not been
    updated there either, so for now patch the function signatures to match
    what is in our textproc/libyaml port.

    PR:             271531
    Approved by:    sunpoet (maintainer)
    MFH:            2023Q2

 devel/py-ruamel.yaml.clib/Makefile                 |  1 +
 .../py-ruamel.yaml.clib/files/patch-clang16 (new)  | 31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
Comment 4 Florian Weimer 2024-02-01 09:21:41 UTC
The Cython files need to be updated as well, see: https://bugzilla.redhat.com/show_bug.cgi?id=2042422#c8

(We run Cython during the build.)