<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 6, 2009, at 12:34 PM, John Thompson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,</div> <div> </div> <div>What's the status of this issue?  (CIndex string returns clobbered)<br></div> <div>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</div> <div> </div></blockquote><div><br></div><div>Hi John,</div><div><br></div>Since these are new API's, the client impact isn't that big a concern.</div><div><br></div><div>There is no doubt that having the client allocate the buffer is the simplest solution. My concern is making the API inconvenient. </div><div><br></div><div>I will make a decision on this within the hour:-)</div><div><br></div><div>Thanks for the follow-up...</div><div><br></div><div>snaroff</div><div><br><blockquote type="cite"> <div>-John<br></div> <div class="gmail_quote">On Wed, Oct 28, 2009 at 4:46 AM, steve naroff <span dir="ltr"><<a href="mailto:snaroff@apple.com">snaroff@apple.com</a>></span> wrote:<br> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"> <div style="WORD-WRAP: break-word"><br> <div> <div class="im"> <div>On Oct 27, 2009, at 7:59 PM, Ted Kremenek wrote:</div><br> <blockquote type="cite"> <div style="WORD-WRAP: break-word">Thanks John.  The patch makes it very clear. <div><br></div> <div>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. <div><br></div> <div>Steve/Doug: I believe you guys discussed this one.  Comments?</div> <div><br></div></div></div></blockquote> <div><br></div></div>Hey Ted,</div> <div><br></div> <div>We haven't discussed it yet. I expect to speak with Doug today/tomorrow and make a decision by the end of the week.</div> <div><br></div> <div>snaroff</div> <div class="im"> <div><br> <blockquote type="cite"> <div style="WORD-WRAP: break-word"> <div> <div> <div> <div>On Oct 27, 2009, at 2:51 PM, John Thompson wrote:</div><br> <blockquote type="cite"> <div class="gmail_quote"> <div>Thanks, Ted.</div> <div> </div> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">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?<br> </blockquote></div> <div>It's in clang_getTranslationUnitSpelling, clang_getDeclSpelling, and clang_getCursorSpelling.  The enclosed patch with my hacky work-around will show the specific places.</div> <div><br>I also moved getLocationFromCursor to fix a VC++ message about the return type not being permitted inside an extern "C" {} block.<br clear="all"></div> <div>-John</div> <div><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br></div><span><cindex_strings.patch></span>_______________________________________________<br> cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br> </blockquote></div><br></div></div></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br> <br> _______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div><br></body></html>