Re: [xml] initGenericErrorDefaultFunc weirdness.




With your suggestion below, I get ' main.c:109: error: invalid lvalue in unary `&' ' With this: initGenericErrorDefaultFunc((xmlGenericErrorFunc)&MyXMLErrorFunction) I still get: 'main.c:109: passing arg 1 of `initGenericErrorDefaultFunc' from incompatible pointer type' error.
        Argh!


Regards,
                Jose.

--
Death, taxes and Microsoft. If you put it that way, the first two don't seem so bad.

On 2 Jun 2004, at 3:37 am, William M. Brack wrote:

Jose Commins said:

        Odd, I am trying to use:

        initGenericErrorDefaultFunc((xmlGenericErrorFunc)MyXMLErrorFunction);

        But I get this error on compilation:

        main.c:109: passing arg 1 of `initGenericErrorDefaultFunc' from
incompatible pointer type

        And here's my function:

void MyXMLErrorFunction(void *ctx, const char *msg, ...)
{
        printf("Aiee!  And error has occured!\n");
}


        I've tried everything: using the direct address, different
assignments
and so on, but I either get the same error or bus errors.  I *do*
have
this working:

        xmlSetGenericErrorFunc(NULL,
(xmlGenericErrorFunc)MyXMLErrorFunction);

        And that works fine.

        But, am I doing something wrong with the declaration/assignment of
'initGenericErrorDefaultFunc' or is it b0rked?


Regards,
                Jose.

From xmlerror.h:
XMLPUBFUN void XMLCALL
    xmlSetGenericErrorFunc      (void *ctx,
                                 xmlGenericErrorFunc handler);
XMLPUBFUN void XMLCALL
    initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);

so perhaps you could try

initGenericErrorDefaultFunc(&(xmlGenericErrorFunc)MyXMLErrorFunction);

(i.e. use the '&' address-of operator)?

Regards,

Bill






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]