Incompatible pointer type, on funtion call, but not on a attribution

Joined
Oct 19, 2010
Messages
2
Reaction score
0
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
 
Joined
Oct 19, 2010
Messages
2
Reaction score
0
SOLVED

There is a damn XXX.h included that have a prototype for dns_aclelement_match, after change the XXX.h and all works fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top