<div dir="auto">Hi,<br><br>I have the following method in C++:<br><br>        bool parseAtom(const char *&scursor, const char* send, QString &result, bool allow8Bit = false);<br><br>The first argument,scursor, is both input to and output from the method. (The third is also output, but is not relevant to this note). When I add the annotations like this:<br><br>        bool parseAtom(const char *&scursor /In,Out/, const char* send, QString &result, bool allow8Bit = false);<br><br>The generated docstring looks plausible:<br><br>        parseAtom(str, str, str, bool = False) -> Tuple[bool, str]<br><br>but the generated code does not compile because it is passed using "&" when I think it should not be:<br><br>        const char* a0;<br>...<br>        if (sipParseArgs(&sipParseErr, sipArgs, "csJ1|b", &a0, &a1, sipType_QString,&a2, &a2State, &a3))<br>        {<br>...<br>            sipRes =  ::KMime::HeaderParsing::parseAtom(&a0,a1,*a2,a3);<br><br>The compilation error is:<br><br>========<br>tmp2/tmp/PyKF5/KMime/KMime/sipKMimeKMimeHeaderParsing.cpp: In function ‘PyObject* meth_KMime_HeaderParsing_parseAtom(PyObject*, PyObject*)’:<br>tmp2/tmp/PyKF5/KMime/KMime/sipKMimeKMimeHeaderParsing.cpp:1385:70: error: no matching function for call to ‘parseAtom(const char**, const char*&, QString&, bool&)’<br>In file included from /usr/include/KF5/KMime/kmime/kmime_headers.h:44:0,<br>                 from /usr/include/KF5/KMime/kmime/kmime_util.h:27,<br>                 from /usr/include/KF5/KMime/kmime/kmime_content.h:53,<br>                 from /usr/include/KF5/KMime/KMime/Content:1,<br>                 from tmp/KMime/KMime/Content.sip:27,<br>                 from unifiedKMime.cpp:1:<br>/usr/include/KF5/KMime/kmime/kmime_header_parsing.h:91:19: note: candidate: bool KMime::HeaderParsing::parseAtom(const char*&, const char*, QString&, bool)<br> KMIME_EXPORT bool parseAtom(const char *&scursor, const char *const send,<br>                   ^~~~~~~~~<br>/usr/include/KF5/KMime/kmime/kmime_header_parsing.h:91:19: note:   no known conversion for argument 1 from ‘const char**’ to ‘const char*&’<br>========<br><br>Notice also the encoding passed to sipParseArgs is "c" (the output without any annotations is below at [1] for reference, and it emits the encoding as "s").<br><br>Am I using the annotations incorrectly, or is this a bug in SIP?<br><br>Thanks, Shaheed<br><br>[1] Without any of the needed annotations, the SIP generated docstring looks as expected:<br><br>        parseAtom(str, str, str, bool = False) -> bool<br><br>and the generated code for the first argument:<br><br>        const char* a0;<br>...<br>        if (sipParseArgs(&sipParseErr, sipArgs, "ssJ1|b", &a0, &a1, sipType_QString,&a2, &a2State, &a3))<br>        {<br>            sipRes =  ::KMime::HeaderParsing::parseAtom(a0,a1,*a2,a3);<br><br>Also, AFAICS, adding the needed /Out/ to argument 3 emits plausible looking code.</div>