-Wincompatible-pointer-type for functions taking a pointer

30 views
Skip to first unread message

David Smith

unread,
Jun 5, 2021, 3:42:06 PM6/5/21
to ats-lang-users

Hey,
I'm trying to use a C library (libwayland) from ATS (still), and now I finally got everything working, but I'm getting a few warnings related to function pointers.

I got the following code

typedef
wl_registry_listener = $extype_struct "struct wl_registry_listener" of
  {
    global= (ptr, !wl_registry1, uint32, string, uint32) -<1> void,
    global_remove= (ptr, !wl_registry1, uint32) -<1> void
  }

However it complains about incompatible pointer types, as ATS seems to use `void *` for the ptr, the registry and the string.

Is there any way I can get rid of this warning or do I just have to live with it?

Thanks in advance!

Hongwei Xi

unread,
Jun 5, 2021, 4:29:10 PM6/5/21
to ats-lan...@googlegroups.com
Yes, you can.

Please take a look at how 'charptr' is handled in the following simple example:


--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/badd3f1d-9c67-4b90-962a-e1207e67c143n%40googlegroups.com.

David Smith

unread,
Jun 7, 2021, 4:02:16 PM6/7/21
to ats-lang-users
Alright, I think I figured it out, thank you!
Reply all
Reply to author
Forward
0 new messages