Describe the bug
When building with the Go Pulsar client, I always see about 10 warnings about incompatible pointer types. Is this a known issue?
To Reproduce
Steps to reproduce the behavior:
โฏ go get -u github.com/apache/pulsar/pulsar-client-go/pulsarScreenshots
GOROOT=/usr/local/Cellar/go/1.13.1/libexec #gosetup
GOPATH=/Users/matthew/go #gosetup
/usr/local/Cellar/go/1.13.1/libexec/bin/go build -o /private/var/folders/z0/f6_lcbw12y74t8hr_zfxr3zr0000gp/T/___ambassador github.com/ETMAInc/platform/services/ambassador #gosetup
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from _cgo_export.c:4:
In file included from c_client.go:24:
../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_go_pulsar.h:75:51: warning: incompatible pointer types passing 'void (pulsar_result, pulsar_message_id_t *, void *)' (aka 'void (pulsar_result, struct _pulsar_message_id *, void *)') to parameter of type 'pulsar_send_callback' (aka 'void (*)(pulsar_result, struct _pulsar_message *, void *)') [-Wincompatible-pointer-types]
/usr/local/include/pulsar/c/producer.h:81:68: note: passing argument to parameter 'callback' here
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from ../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_client.go:24:
../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_go_pulsar.h:75:51: warning: incompatible pointer types passing 'void (pulsar_result, pulsar_message_id_t *, void *)' (aka 'void (pulsar_result, struct _pulsar_message_id *, void *)') to parameter of type 'pulsar_send_callback' (aka 'void (*)(pulsar_result, struct _pulsar_message *, void *)') [-Wincompatible-pointer-types]
/usr/local/include/pulsar/c/producer.h:81:68: note: passing argument to parameter 'callback' here
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from ../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_consumer.go:23:
../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_go_pulsar.h:75:51: warning: incompatible pointer types passing 'void (pulsar_result, pulsar_message_id_t *, void *)' (aka 'void (pulsar_result, struct _pulsar_message_id *, void *)') to parameter of type 'pulsar_send_callback' (aka 'void (*)(pulsar_result, struct _pulsar_message *, void *)') [-Wincompatible-pointer-types]
/usr/local/include/pulsar/c/producer.h:81:68: note: passing argument to parameter 'callback' here
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from ../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_error.go:25:
../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_go_pulsar.h:75:51: warning: incompatible pointer types passing 'void (pulsar_result, pulsar_message_id_t *, void *)' (aka 'void (pulsar_result, struct _pulsar_message_id *, void *)') to parameter of type 'pulsar_send_callback' (aka 'void (*)(pulsar_result, struct _pulsar_message *, void *)') [-Wincompatible-pointer-types]
/usr/local/include/pulsar/c/producer.h:81:68: note: passing argument to parameter 'callback' here
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from ../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_message.go:23:
../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_go_pulsar.h:75:51: warning: incompatible pointer types passing 'void (pulsar_result, pulsar_message_id_t *, void *)' (aka 'void (pulsar_result, struct _pulsar_message_id *, void *)') to parameter of type 'pulsar_send_callback' (aka 'void (*)(pulsar_result, struct _pulsar_message *, void *)') [-Wincompatible-pointer-types]
/usr/local/include/pulsar/c/producer.h:81:68: note: passing argument to parameter 'callback' here
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from ../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_producer.go:23:
../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_go_pulsar.h:75:51: warning: incompatible pointer types passing 'void (pulsar_result, pulsar_message_id_t *, void *)' (aka 'void (pulsar_result, struct _pulsar_message_id *, void *)') to parameter of type 'pulsar_send_callback' (aka 'void (*)(pulsar_result, struct _pulsar_message *, void *)') [-Wincompatible-pointer-types]
/usr/local/include/pulsar/c/producer.h:81:68: note: passing argument to parameter 'callback' here
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from ../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_reader.go:23:
../../../../go/pkg/mod/github.com/apache/pulsar/[email protected]/pulsar/c_go_pulsar.h:75:51: warning: incompatible pointer types passing 'void (pulsar_result, pulsar_message_id_t *, void *)' (aka 'void (pulsar_result, struct _pulsar_message_id *, void *)') to parameter of type 'pulsar_send_callback' (aka 'void (*)(pulsar_result, struct _pulsar_message *, void *)') [-Wincompatible-pointer-types]
/usr/local/include/pulsar/c/producer.h:81:68: note: passing argument to parameter 'callback' here
Desktop (please complete the following information):
Is this a known issue?
Yes, this is a known issue. This does not affect normal use. The issue was caused by the introduction of the SendAndGetMsgID interface.
Would it be possible to fix this known message, please?
This would clean the build message a lot !
Workaround: edit pulsar/c_client.go and just before the line beginning #include, add:
#cgo CFLAGS: -Wno-incompatible-pointer-types
Most helpful comment
Would it be possible to fix this known message, please?
This would clean the build message a lot !