Skip to content

Build failure: Compilation errors in hb_beamr.c #932

Description

@bc1Matin

When attempting to compile the project using rebar3 compile on Erlang 27.3.4.11, the build fails due to strict type mismatches in native/hb_beamr/hb_beamr.c when calling functions from the ei.h library (erl_interface).

Environment

*OS: Linux arch
*Erlang Version: 27.3.4.11 (installed via asdf)
*Rebar Version: 3.27.0 (installed via asdf)
*GCC version: 16.1.1

Build Log

===> Compiling /home/matin/repos/HyperBEAM/native/hb_beamr/hb_beamr.c
===> /home/matin/repos/HyperBEAM/native/hb_beamr/hb_beamr.c: In function ‘wasm_driver_output’:
/home/matin/repos/HyperBEAM/native/hb_beamr/hb_beamr.c:176:42: error: passing argument 4 of ‘ei_get_type’ from incompatible pointer type [-Wincompatible-pointer-types]
  176 |         ei_get_type(buff, &index, &type, &size);
      |                                          ^~~~~
      |                                          |
      |                                          long int *
In file included from native/hb_beamr/include/hb_core.h:5,
                 from native/hb_beamr/include/hb_helpers.h:4,
                 from /home/matin/repos/HyperBEAM/native/hb_beamr/hb_beamr.c:1:
/home/matin/.asdf/installs/erlang/27.3.4.11/lib/erl_interface-5.5.2/include/ei.h:555:68: note: expected ‘int *’ but argument is of type ‘long int *’
  555 | int ei_get_type(const char *buf, const int *index, int *type, int *size);
      |                                                               ~~~~~^~~~
/home/matin/repos/HyperBEAM/native/hb_beamr/hb_beamr.c:179:53: error: passing argument 3 of ‘ei_decode_bitstring’ from incompatible pointer type [-Wincompatible-pointer-types]
  179 |         int res = ei_decode_bitstring(buff, &index, &wasm_binary, NULL, &size_l);
      |                                                     ^~~~~~~~~~~~
      |                                                     |
      |                                                     char **
/home/matin/.asdf/installs/erlang/27.3.4.11/lib/erl_interface-5.5.2/include/ei.h:574:67: note: expected ‘const char **’ but argument is of type ‘char **’
  574 | int ei_decode_bitstring(const char *buf, int *index, const char** pp,
      |                                                      ~~~~~~~~~~~~~^~
/home/matin/repos/HyperBEAM/native/hb_beamr/hb_beamr.c:179:73: warning: pointer targets in passing argument 5 of ‘ei_decode_bitstring’ differ in signedness [-Wpointer-sign]
  179 |         int res = ei_decode_bitstring(buff, &index, &wasm_binary, NULL, &size_l);
      |                                                                         ^~~~~~~
      |                                                                         |
      |                                                                         long int *
/home/matin/.asdf/installs/erlang/27.3.4.11/lib/erl_interface-5.5.2/include/ei.h:575:57: note: expected ‘size_t *’ {aka ‘long unsigned int *’} but argument is of type ‘long int *’
  575 |                         unsigned int* bitoffsp, size_t *nbitsp);
      |                                                 ~~~~~~~~^~~~~~

✗ rebar3 compile failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions