Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible pointer types error #784

Open
jamesjer opened this issue Aug 13, 2024 · 2 comments
Open

Incompatible pointer types error #784

jamesjer opened this issue Aug 13, 2024 · 2 comments
Labels

Comments

@jamesjer
Copy link

Describe the bug

context
When I compile ocaml-ctypes 0.23.0 with gcc 14.1.1 and run the tests, one test fails. GCC 14.x is stricter about incompatible pointer types than previous versions of GCC.

expectation
I expect the tests to pass.

bug
But instead the compiler throws an error:

generated_stubs.c: In function ‘cstubs_tests_2_new_chorse’:
generated_stubs.c:14:25: error: initialization of ‘struct animal *’ from incompatible pointer type ‘struct chorse *’ [-Wincompatible-pointer-types]
   14 |    struct animal* x10 = new_chorse(x7);
      |                         ^~~~~~~~~~

This code appears to have been generated from tests/test-oo_style/stubs/functions.ml, lines 84 and 85.

problem
This is a problem for Linux distribution packagers, because we want to see package tests succeed.

Reproduce the bug

  1. Gain access to a machine with GCC 14.x; I am using Fedora Rawhide.
  2. Build ocaml-ctypes 0.23.0
  3. Run the tests

List your environment

The following Fedora packages are installed (not a complete list; devel packages are also installed in most cases):

  • gcc-14.1.1-7.fc41.x86_64
  • libffi-3.4.6-2.fc41.x86_64
  • ocaml-5.2.0-3.fc41.x86_64
  • ocaml-bigarray-compat-1.1.0-17.fc41.x86_64
  • ocaml-bisect-ppx-2.8.3-13.fc41.x86_64
  • ocaml-dune-3.16.0-3.fc41.x86_64
  • ocaml-dune-configurator-3.16.0-3.fc41.x86_64
  • ocaml-integers-0.7.0-16.fc41.x86_64
  • ocaml-lwt-5.7.0-13.fc41.x86_64
  • ocaml-ounit-2.2.7-11.fc41.x86_64
@jamesjer jamesjer added the bug label Aug 13, 2024
@yallop
Copy link
Owner

yallop commented Aug 13, 2024

Thank you for the report, @jamesjer. There's a fix for the test in #785. I can make a 0.23.1 release that includes the fix, if that'd be useful.

@jamesjer
Copy link
Author

Thank you for the quick response! I'm okay with waiting until the next time you have a reason to make a release, actually. I can patch the test locally until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants