<div dir="ltr"><font face="arial,helvetica,sans-serif">There was just an article on Slashdot about FreeBSD abondoning gcc in favor of clang. I hadn't encountered clang before, and have read up on it since. The big difference between gcc and clang was that clang was written from the very beginning to be reusable tool, around which various functionalities can be built. E.g. a package that does syntax aware source code completion in emacs and vim. See:<br>
<br><a href="http://kristianrumberg.wordpress.com/2010/04/22/smart-autocompletion-for-c-in-emacs/">http://kristianrumberg.wordpress.com/2010/04/22/smart-autocompletion-for-c-in-emacs/</a><br><a href="http://lang.llvm.org">lang.llvm.org</a><br>
<br>There is also a gcc port that does something similar. See:<br><br><a href="http://cx4a.org/software/gccsense/">http://cx4a.org/software/gccsense/</a><br><br>Here is another related link:<br><br><a href="http://stackoverflow.com/questions/5454803/gccsense-vs-clang-complete">http://stackoverflow.com/questions/5454803/gccsense-vs-clang-complete</a><br>
<br></font>Regards,<br>Dov<br><br><div class="gmail_quote">On Mon, May 14, 2012 at 9:19 AM, Gilboa Davara <span dir="ltr"><<a href="mailto:gilboad@gmail.com" target="_blank">gilboad@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, May 14, 2012 at 9:03 AM, Baruch Siach <<a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a>> wrote:<br>
> Hi Gilboa,<br>
><br>
> On Mon, May 14, 2012 at 08:52:39AM +0300, Gilboa Davara wrote:<br>
>> On Mon, May 14, 2012 at 7:34 AM, Baruch Siach <<a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a>> wrote:<br>
>> > I'm looking for a tool that can do semantic search is a body of C code.<br>
>> > Example query: "give me all references to field y in struct x defined in<br>
>> > file z.h". I would prefer an open source, command line driven tool. C++<br>
>> > support is an advantage. Does such a tool exist?<br>
>><br>
>> I use cscope for more-or-less the same requirements.<br>
><br>
> I've tried cscope, but I couldn't find a way to find references to a field in<br>
> a specific struct. Can this be done with cscope?<br>
><br>
> baruch<br>
><br>
<br>
</div>In theory cscope f t (find text) can do it, but it won't be very<br>
efficient and my suffer from high rate of false positives.<br>
Per your requirements, I'd suggest you consider using grep to filter<br>
the results of cscope find s.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Gilboa<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</div></div></blockquote></div><br><div style id="divCleekiAttrib"></div></div>