[cfe-dev] CIndex changes

John Thompson john.thompson.jtsoftware at gmail.com
Fri Nov 6 09:34:28 PST 2009


Hi,

What's the status of this issue?  (CIndex string returns clobbered)
>From purely a programming point of view, I still think changing the API for
these functions to have the user pass in a string buffer and max length and
then return the buffer pointer seems the most reasonable thing to do.  But I
don't know the extent of your client impact, which I presume is the reason
for the reluctance to change the API

-John
On Wed, Oct 28, 2009 at 4:46 AM, steve naroff <snaroff at apple.com> wrote:

>
>  On Oct 27, 2009, at 7:59 PM, Ted Kremenek wrote:
>
>  Thanks John.  The patch makes it very clear.
>
> The problem is that we don't want to add static data to CIndex, as we want
> the functions to be as reentrant as possible.
>
> Steve/Doug: I believe you guys discussed this one.  Comments?
>
>
> Hey Ted,
>
> We haven't discussed it yet. I expect to speak with Doug today/tomorrow and
> make a decision by the end of the week.
>
> snaroff
>
>    On Oct 27, 2009, at 2:51 PM, John Thompson wrote:
>
>  Thanks, Ted.
>
>
>> I'm sorry I've been disconnected from this.  What particular code were you
>> looking at that returned a 'const char*' that referred to the buffer
>> associated with a temporary std::string?
>>
> It's in clang_getTranslationUnitSpelling, clang_getDeclSpelling, and
> clang_getCursorSpelling.  The enclosed patch with my hacky work-around will
> show the specific places.
>
> I also moved getLocationFromCursor to fix a VC++ message about the return
> type not being permitted inside an extern "C" {} block.
> -John
>
> --
> John Thompson
> John.Thompson.JTSoftware at gmail.com
>
> <cindex_strings.patch>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>
>


-- 
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091106/076cf3b3/attachment.html>


More information about the cfe-dev mailing list