Skip to content

Doesn't compile #24

@ba1l3ys

Description

@ba1l3ys

When building the Rust application with the onig_sys crate (version 69.8.1), compilation fails with incompatible pointer type errors in the oniguruma C library (specifically in regparse.c).

Setting the RUSTFLAGS="-Wno-error=incompatible-pointer-types" flag doesn't resolve the issue.

error: failed to run custom build command for `onig_sys v69.8.1`

Caused by:
  process didn't exit successfully: `chatty/target/debug/build/onig_sys-ce9b33e47d59787a/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=RUSTONIG_DYNAMIC_LIBONIG
  cargo:rerun-if-env-changed=RUSTONIG_STATIC_LIBONIG
  cargo:rerun-if-env-changed=RUSTONIG_SYSTEM_LIBONIG
  OUT_DIR = Some(chatty/target/debug/build/onig_sys-574ac15fd5bcb408/out)
  OPT_LEVEL = Some(0)
  TARGET = Some(x86_64-unknown-linux-gnu)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  CARGO_ENCODED_RUSTFLAGS = Some(-Wno-error=incompatible-pointer-types)
  cargo:warning=oniguruma/src/regparse.c: In function 'onig_st_init_strend_table_with_size':
  cargo:warning=oniguruma/src/regparse.c:588:5: error: initialization of 'int (*)(void)' from incompatible pointer type 'int (*)(st_str_end_key *, st_str_end_key *)' [-Wincompatible-pointer-types]
  cargo:warning=  588 |     str_end_cmp,
  cargo:warning=      |     ^~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c:588:5: note: (near initialization for 'hashType.compare')
  cargo:warning=oniguruma/src/regparse.c:550:1: note: 'str_end_cmp' declared here
  cargo:warning=  550 | str_end_cmp(st_str_end_key* x, st_str_end_key* y)
  cargo:warning=      | ^~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c:589:5: error: initialization of 'int (*)(void)' from incompatible pointer type 'int (*)(st_str_end_key *)' [-Wincompatible-pointer-types]
  cargo:warning=  589 |     str_end_hash,
  cargo:warning=      |     ^~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c:589:5: note: (near initialization for 'hashType.hash')
  cargo:warning=oniguruma/src/regparse.c:571:1: note: 'str_end_hash' declared here
  cargo:warning=  571 | str_end_hash(st_str_end_key* x)
  cargo:warning=      | ^~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c: In function 'onig_st_init_callout_name_table_with_size':
  cargo:warning=oniguruma/src/regparse.c:678:5: error: initialization of 'int (*)(void)' from incompatible pointer type 'int (*)(st_callout_name_key *, st_callout_name_key *)' [-Wincompatible-pointer-types]
  cargo:warning=  678 |     callout_name_table_cmp,
  cargo:warning=      |     ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c:678:5: note: (near initialization for 'hashType.compare')
  cargo:warning=oniguruma/src/regparse.c:637:1: note: 'callout_name_table_cmp' declared here
  cargo:warning=  637 | callout_name_table_cmp(st_callout_name_key* x, st_callout_name_key* y)
  cargo:warning=      | ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c:679:5: error: initialization of 'int (*)(void)' from incompatible pointer type 'int (*)(st_callout_name_key *)' [-Wincompatible-pointer-types]
  cargo:warning=  679 |     callout_name_table_hash,
  cargo:warning=      |     ^~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c:679:5: note: (near initialization for 'hashType.hash')
  cargo:warning=oniguruma/src/regparse.c:660:1: note: 'callout_name_table_hash' declared here
  cargo:warning=  660 | callout_name_table_hash(st_callout_name_key* x)
  cargo:warning=      | ^~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c: In function 'names_clear':
  cargo:warning=oniguruma/src/regparse.c:804:24: error: passing argument 2 of 'onig_st_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
  cargo:warning=  804 |     onig_st_foreach(t, i_free_name_entry, 0);
  cargo:warning=      |                        ^~~~~~~~~~~~~~~~~
  cargo:warning=      |                        |
  cargo:warning=      |                        int (*)(OnigUChar *, NameEntry *, void *) {aka int (*)(unsigned char *, NameEntry *, void *)}
  cargo:warning=In file included from oniguruma/src/regparse.c:37:
  cargo:warning=oniguruma/src/st.h:55:31: note: expected 'int (*)(void)' but argument is of type 'int (*)(OnigUChar *, NameEntry *, void *)' {aka 'int (*)(unsigned char *, NameEntry *, void *)'}
  cargo:warning=   55 | int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
  cargo:warning=      |                               ^~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/st.h:35:18: note: in definition of macro '_'
  cargo:warning=   35 | # define _(args) args
  cargo:warning=      |                  ^~~~
  cargo:warning=oniguruma/src/regparse.c:789:1: note: 'i_free_name_entry' declared here
  cargo:warning=  789 | i_free_name_entry(UChar* key, NameEntry* e, void* arg ARG_UNUSED)
  cargo:warning=      | ^~~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c: In function 'onig_foreach_name':
  cargo:warning=oniguruma/src/regparse.c:873:24: error: passing argument 2 of 'onig_st_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
  cargo:warning=  873 |     onig_st_foreach(t, i_names, (HashDataType )&narg);
  cargo:warning=      |                        ^~~~~~~
  cargo:warning=      |                        |
  cargo:warning=      |                        int (*)(OnigUChar *, NameEntry *, INamesArg *) {aka int (*)(unsigned char *, NameEntry *, INamesArg *)}
  cargo:warning=oniguruma/src/st.h:55:31: note: expected 'int (*)(void)' but argument is of type 'int (*)(OnigUChar *, NameEntry *, INamesArg *)' {aka 'int (*)(unsigned char *, NameEntry *, INamesArg *)'}
  cargo:warning=   55 | int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
  cargo:warning=      |                               ^~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/st.h:35:18: note: in definition of macro '_'
  cargo:warning=   35 | # define _(args) args
  cargo:warning=      |                  ^~~~
  cargo:warning=oniguruma/src/regparse.c:846:1: note: 'i_names' declared here
  cargo:warning=  846 | i_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg)
  cargo:warning=      | ^~~~~~~
  cargo:warning=oniguruma/src/regparse.c: In function 'onig_renumber_name_table':
  cargo:warning=oniguruma/src/regparse.c:901:24: error: passing argument 2 of 'onig_st_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
  cargo:warning=  901 |     onig_st_foreach(t, i_renumber_name, (HashDataType )map);
  cargo:warning=      |                        ^~~~~~~~~~~~~~~
  cargo:warning=      |                        |
  cargo:warning=      |                        int (*)(OnigUChar *, NameEntry *, GroupNumMap *) {aka int (*)(unsigned char *, NameEntry *, GroupNumMap *)}
  cargo:warning=oniguruma/src/st.h:55:31: note: expected 'int (*)(void)' but argument is of type 'int (*)(OnigUChar *, NameEntry *, GroupNumMap *)' {aka 'int (*)(unsigned char *, NameEntry *, GroupNumMap *)'}
  cargo:warning=   55 | int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
  cargo:warning=      |                               ^~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/st.h:35:18: note: in definition of macro '_'
  cargo:warning=   35 | # define _(args) args
  cargo:warning=      |                  ^~~~
  cargo:warning=oniguruma/src/regparse.c:879:1: note: 'i_renumber_name' declared here
  cargo:warning=  879 | i_renumber_name(UChar* key ARG_UNUSED, NameEntry* e, GroupNumMap* map)
  cargo:warning=      | ^~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c: In function 'callout_name_table_clear':
  cargo:warning=oniguruma/src/regparse.c:1386:24: error: passing argument 2 of 'onig_st_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
  cargo:warning= 1386 |     onig_st_foreach(t, i_free_callout_name_entry, 0);
  cargo:warning=      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                        |
  cargo:warning=      |                        int (*)(st_callout_name_key *, CalloutNameEntry *, void *)
  cargo:warning=oniguruma/src/st.h:55:31: note: expected 'int (*)(void)' but argument is of type 'int (*)(st_callout_name_key *, CalloutNameEntry *, void *)'
  cargo:warning=   55 | int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
  cargo:warning=      |                               ^~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/st.h:35:18: note: in definition of macro '_'
  cargo:warning=   35 | # define _(args) args
  cargo:warning=      |                  ^~~~
  cargo:warning=oniguruma/src/regparse.c:1370:1: note: 'i_free_callout_name_entry' declared here
  cargo:warning= 1370 | i_free_callout_name_entry(st_callout_name_key* key, CalloutNameEntry* e,
  cargo:warning=      | ^~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c: In function 'setup_ext_callout_list_values':
  cargo:warning=oniguruma/src/regparse.c:1884:56: error: passing argument 2 of 'onig_st_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
  cargo:warning= 1884 |     onig_st_foreach((CalloutTagTable *)ext->tag_table, i_callout_callout_list_set,
  cargo:warning=      |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                        |
  cargo:warning=      |                                                        int (*)(OnigUChar *, CalloutTagVal,  void *) {aka int (*)(unsigned char *, long int,  void *)}
  cargo:warning=oniguruma/src/st.h:55:31: note: expected 'int (*)(void)' but argument is of type 'int (*)(OnigUChar *, CalloutTagVal,  void *)' {aka 'int (*)(unsigned char *, long int,  void *)'}
  cargo:warning=   55 | int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
  cargo:warning=      |                               ^~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/st.h:35:18: note: in definition of macro '_'
  cargo:warning=   35 | # define _(args) args
  cargo:warning=      |                  ^~~~
  cargo:warning=oniguruma/src/regparse.c:1866:1: note: 'i_callout_callout_list_set' declared here
  cargo:warning= 1866 | i_callout_callout_list_set(UChar* key, CalloutTagVal e, void* arg)
  cargo:warning=      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/regparse.c: In function 'callout_tag_table_clear':
  cargo:warning=oniguruma/src/regparse.c:1932:24: error: passing argument 2 of 'onig_st_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
  cargo:warning= 1932 |     onig_st_foreach(t, i_free_callout_tag_entry, 0);
  cargo:warning=      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                        |
  cargo:warning=      |                        int (*)(OnigUChar *, CalloutTagVal,  void *) {aka int (*)(unsigned char *, long int,  void *)}
  cargo:warning=oniguruma/src/st.h:55:31: note: expected 'int (*)(void)' but argument is of type 'int (*)(OnigUChar *, CalloutTagVal,  void *)' {aka 'int (*)(unsigned char *, long int,  void *)'}
  cargo:warning=   55 | int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
  cargo:warning=      |                               ^~~~~~~~~~~~~~~~
  cargo:warning=oniguruma/src/st.h:35:18: note: in definition of macro '_'
  cargo:warning=   35 | # define _(args) args
  cargo:warning=      |                  ^~~~
  cargo:warning=oniguruma/src/regparse.c:1922:1: note: 'i_free_callout_tag_entry' declared here
  cargo:warning= 1922 | i_free_callout_tag_entry(UChar* key, CalloutTagVal e, void* arg ARG_UNUSED)
  cargo:warning=      | ^~~~~~~~~~~~~~~~~~~~~~~~

  --- stderr


  error occurred in cc-rs: command did not execute successfully (status code exit status: 1): LC_ALL="C" "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "chatty/target/debug/build/onig_sys-574ac15fd5bcb408/out" "-I" "oniguruma/src" "-DHAVE_UNISTD_H=1" "-DHAVE_SYS_TYPES_H=1" "-DHAVE_SYS_TIME_H=1" "-o" "chatty/target/debug/build/onig_sys-574ac15fd5bcb408/out/a445302c6d3dcb51-regparse.o" "-c" "oniguruma/src/regparse."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions