Hello, I have a problema with above code, please some one can help me?
...
isc_boolean_t
dns_aclelement_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
dns_aclelement_t *e , // << THIS NOT! :/
const dns_aclenv_t *env,
const dns_aclelement_t **matchelt)
...
somefunction (...){
...
dns_aclelement_t *e = &acl->elements; //<< THIS WORKS!!! :/
....
dns_aclelement_match(reqaddr, reqsigner,
&e, env, matchelt))
...
}
Compiler errors:
acl.c:309: warning: passing argument 3 of ‘dns_aclelement_match’ from incompatible pointer type
acl.c: At top level:
acl.c:439: error: conflicting types for ‘dns_aclelement_match’
include/dns/acl.h:350: error: previous declaration of ‘dns_aclelement_match’ was here
IF i do in this way, its works:
...
isc_boolean_t
dns_aclelement_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
const dns_aclelement_t *e , // << THIS WORKS! :///
const dns_aclenv_t *env,
const dns_aclelement_t **matchelt)
...
somefunction (...){
...
dns_aclelement_t *e = &acl->elements; //<< THIS WORKS!!! :////
....
dns_aclelement_match(reqaddr, reqsigner,
&e, env, matchelt))
...
}
Why the const in necessery on the function declation and not on the attribution, i need to pass this variable by reference to the function and alter it inside this function. How can i do this??
Thanks everyone.
Sky
...
isc_boolean_t
dns_aclelement_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
dns_aclelement_t *e , // << THIS NOT! :/
const dns_aclenv_t *env,
const dns_aclelement_t **matchelt)
...
somefunction (...){
...
dns_aclelement_t *e = &acl->elements; //<< THIS WORKS!!! :/
....
dns_aclelement_match(reqaddr, reqsigner,
&e, env, matchelt))
...
}
Compiler errors:
acl.c:309: warning: passing argument 3 of ‘dns_aclelement_match’ from incompatible pointer type
acl.c: At top level:
acl.c:439: error: conflicting types for ‘dns_aclelement_match’
include/dns/acl.h:350: error: previous declaration of ‘dns_aclelement_match’ was here
IF i do in this way, its works:
...
isc_boolean_t
dns_aclelement_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
const dns_aclelement_t *e , // << THIS WORKS! :///
const dns_aclenv_t *env,
const dns_aclelement_t **matchelt)
...
somefunction (...){
...
dns_aclelement_t *e = &acl->elements; //<< THIS WORKS!!! :////
....
dns_aclelement_match(reqaddr, reqsigner,
&e, env, matchelt))
...
}
Why the const in necessery on the function declation and not on the attribution, i need to pass this variable by reference to the function and alter it inside this function. How can i do this??
Thanks everyone.
Sky