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

Discussion in 'C Programming' started by skyshade, Oct 19, 2010.

  1. skyshade

    skyshade

    Joined:
    Oct 19, 2010
    Messages:
    2
    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
     
    skyshade, Oct 19, 2010
    #1
    1. Advertising

  2. skyshade

    skyshade

    Joined:
    Oct 19, 2010
    Messages:
    2
    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.
     
    skyshade, Oct 19, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2VuTGVl?=
    Replies:
    1
    Views:
    7,869
    Mark Newmister
    Feb 13, 2006
  2. Knoppix User
    Replies:
    3
    Views:
    304
    Knoppix User
    Jan 11, 2004
  3. Lee Xuzhang
    Replies:
    5
    Views:
    352
    Kevin D. Quitt
    Jun 14, 2006
  4. Douglas Alan
    Replies:
    0
    Views:
    258
    Douglas Alan
    Jun 14, 2007
  5. Art Merkel
    Replies:
    4
    Views:
    147
    Adam Funk
    Feb 6, 2007
Loading...

Share This Page