Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Incompatible pointer type, on funtion call, but not on a attribution

Reply
Thread Tools

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

 
 
skyshade skyshade is offline
Junior Member
Join Date: Oct 2010
Posts: 2
 
      10-19-2010
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[i]; //<< 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[i]; //<< 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
 
Reply With Quote
 
 
 
 
skyshade skyshade is offline
Junior Member
Join Date: Oct 2010
Posts: 2
 
      10-19-2010
There is a damn XXX.h included that have a prototype for dns_aclelement_match, after change the XXX.h and all works fine.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I passing a funtion pointer to a FUNTION which point to THE FUNTION? Lee Xuzhang C Programming 5 06-14-2006 06:31 PM
validation(asp.net):attribution onblur is not a valid attribute of =?Utf-8?B?S2VuTGVl?= ASP .Net 1 02-13-2006 03:35 PM
Posts that don't have attribution symbols Toolman Tim Computer Support 12 02-25-2005 07:25 AM
How can we define a funtion pointer to point a member function of a class? C++ 6 07-15-2004 04:14 AM
[Newb] Still not able to solve class attribution Knoppix User Python 3 01-11-2004 10:43 PM



Advertisments