<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi John,<div><br></div><div>Comments below...</div><div><br><div><div>On Oct 20, 2009, at 11:03 AM, John Thompson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Now that I have electricity again...</div> <div> </div> <div>Sorry, I was looking too deep, not noticing that the function returned a std::string.  The problem was up higher in CIndex.cpp, in a couple of the functions that return const char *, with the same problem I described of the temporary going away before the string can be used.</div> <div> </div></blockquote><div><br></div>Nice catch. I guess other platforms are more forgiving...</div><div><br><blockquote type="cite"> <div>I worked around it by using a static buffer, which is admittedly not so good.  A cleaner way might be to have the user pass in a string buffer, since it seems this needs to be a C interface.  Should I do that, or does the API need to remain unchanged?  Let me know if there's a better way.</div> <div> </div></blockquote><div><br></div>I'd like to avoid cluttering the interface if possible. I'm not an expert on std::String, so I'll have to look into this. I'll get back to you...</div><div><br><blockquote type="cite"> <div>The enclosed patch contains my hacked version, which also includes the DLL exporting glue (redone in the naming style I'm used to - apologies to Jeff Krall, who'd already done it).</div> <div> </div></blockquote><div><br></div>Can you separate this from the other stuff in the patch? I'd like to keep this type of mechanical change separate from the trickier stuff...</div><div><br><blockquote type="cite"> <div>Note that I moved the getLocationFromCursor function out of the extern "C" {} because MSVC was complaining about it because of the object return type.</div> <div> </div> <div>Where does "basename" come from on the non-Windows platforms?  It was unresolved, so I guessed at it, but which seems to work.</div> <div> </div></blockquote><div><br></div>basename is a Unix/Linux function...not standard C or POSIX. Does Windows have something called _splitpath()?</div><div><br><blockquote type="cite"> <div>The c-index-api-test.m test passes on Windows with these changes.</div></blockquote><div><br></div>Great. Thanks for helping out on this!</div><div><br></div><div>snaroff</div><div><br><blockquote type="cite"> <div> </div> <div>-John<br></div> <div class="gmail_quote">On Mon, Oct 19, 2009 at 12:14 PM, John Thompson <span dir="ltr"><<a href="mailto:john.thompson.jtsoftware@gmail.com">john.thompson.jtsoftware@gmail.com</a>></span> wrote:<br> <blockquote style="border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; padding-left: 1ex; position: static; z-index: auto; " class="gmail_quote"> <div>I'm looking at a test failure of c-index-api-test.m on Windows, and I've run into a problem I don't know how to easily fix.</div> <div> </div> <div>In the function Selector::getAsString function in IdentifierTable.cpp at line 330:</div> <div> </div> <div>    return II->getName().str() + ":";<br><br clear="all">On Windows, at least, this isn't working as expected.  I think it's because a tempory string created gets destructed before the return completes, causing the resulting string pointer to point to garbage, resulting in garbage for the identifier name in the index output.</div> <div></div> <div> </div> <div>If someone more knowlegeable about it could take a look at it, I'd appreciate it.</div> <div> </div> <div>Note that if you need to run it on windows, you'll need some CIndex changes I'm working on, but haven't completed yet, so let me know if you need them.</div> <div> </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></blockquote></div><br><br clear="all"> <div></div><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br> <span><cindex.patch></span>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></body></html>