assignment from incompatible pointer type

Andrey Oktyabrskiy ano at bestmx.net
Thu Feb 3 10:40:42 UTC 2022


Strange error during "go build":

# unit.nginx.org/go
nxt_cgo_lib.c: In function ‘nxt_cgo_run’:
nxt_cgo_lib.c:29:36: warning: assignment to ‘void (*)(nxt_unit_t *, 
nxt_unit_ctx_t *, nxt_unit_port_t *)’ {aka ‘void (*)(struct nxt_unit_s 
*, struct nxt_unit_ctx_s *, struct nxt_unit_port_s *)’} from 
incompatible pointer type ‘void (*)(nxt_unit_t *, nxt_unit_port_t *)’ 
{aka ‘void (*)(struct nxt_unit_s *, struct nxt_unit_port_s *)’} 
[-Wincompatible-pointer-types]
    29 |     init.callbacks.remove_port     = nxt_go_remove_port;
       |                                    ^
nxt_cgo_lib.c:31:36: warning: assignment to ‘ssize_t (*)(nxt_unit_ctx_t 
*, nxt_unit_port_t *, void *, size_t,  void *, size_t *)’ {aka ‘long int 
(*)(struct nxt_unit_ctx_s *, struct nxt_unit_port_s *, void *, long 
unsigned int,  void *, long unsigned int *)’} from incompatible pointer 
type ‘ssize_t (*)(nxt_unit_ctx_t *, nxt_unit_port_t *, void *, size_t, 
void *, size_t)’ {aka ‘long int (*)(struct nxt_unit_ctx_s *, struct 
nxt_unit_port_s *, void *, long unsigned int,  void *, long unsigned 
int)’} [-Wincompatible-pointer-types]
    31 |     init.callbacks.port_recv       = nxt_cgo_port_recv;
       |                                    ^


What's wrong and how to fix?



More information about the unit mailing list