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

Fix incompatible pointer type error #175

Closed
wants to merge 1 commit into from
Closed

Fix incompatible pointer type error #175

wants to merge 1 commit into from

Conversation

jamesjer
Copy link
Contributor

@jamesjer jamesjer commented Feb 2, 2024

The Fedora project is starting to build packages with a GCC 14 prerelease. It is pickier about incompatible types than previous versions. Building lablgtk3 3.1.4 yields this error:

ml_gtk.c: In function ‘ml_gtk_style_context_list_classes’:
wrappers.h:422:20: error: passing argument 2 of ‘Val_GList’ from incompatible pointer type [-Wincompatible-pointer-types]
  422 | #define Val_string copy_string_check
      |                    ^~~~~~~~~~~~~~~~~
      |                    |
      |                    value (*)(const char *) {aka long int (*)(const char *)}
ml_gtk.c:236:78: note: in expansion of macro ‘Val_string’
  236 | { return Val_GList(gtk_style_context_list_classes(GtkStyleContext_val(ctx)), Val_string); }
      |                                                                              ^~~~~~~~~~
In file included from ml_gtk.c:37:
ml_glib.h:30:42: note: expected ‘value_in’ {aka ‘long int (*)(void *)’} but argument is of type ‘value (*)(const char *)’ {aka ‘long int (*)(const char *)’}
   30 | CAMLexport value Val_GList (GList *list, value_in);
      |                                          ^~~~~~~~

Completely unrelated, but I would also like to point out that dune-project still has (version 3.1.2).

@vbgl
Copy link

vbgl commented Feb 12, 2024

I’ve observed the same error with Clang 16.0.6:

ml_gtk.c:236:78: error: incompatible function pointer types passing 'value (const char *)' (aka 'long (const char )') to parameter of type 'value_in' (aka 'long ()(void *)') [-Wincompatible-function-pointer-types]
{ return Val_GList(gtk_style_context_list_classes(GtkStyleContext_val(ctx)), Val_string); }
^~~~~~~~~~
./wrappers.h:422:20: note: expanded from macro 'Val_string'
#define Val_string copy_string_check
^~~~~~~~~~~~~~~~~
./ml_glib.h:30:50: note: passing argument to parameter here
CAMLexport value Val_GList (GList *list, value_in);
^

@garrigue
Copy link
Owner

Already fixed in fix to #178.

@garrigue garrigue closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants