<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&#39;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">&lt;<a href="mailto:gilboad@gmail.com" target="_blank">gilboad@gmail.com</a>&gt;</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 &lt;<a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a>&gt; wrote:<br>
&gt; Hi Gilboa,<br>
&gt;<br>
&gt; On Mon, May 14, 2012 at 08:52:39AM +0300, Gilboa Davara wrote:<br>
&gt;&gt; On Mon, May 14, 2012 at 7:34 AM, Baruch Siach &lt;<a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a>&gt; wrote:<br>
&gt;&gt; &gt; I&#39;m looking for a tool that can do semantic search is a body of C code.<br>
&gt;&gt; &gt; Example query: &quot;give me all references to field y in struct x defined in<br>
&gt;&gt; &gt; file z.h&quot;. I would prefer an open source, command line driven tool. C++<br>
&gt;&gt; &gt; support is an advantage. Does such a tool exist?<br>
&gt;&gt;<br>
&gt;&gt; I use cscope for more-or-less the same requirements.<br>
&gt;<br>
&gt; I&#39;ve tried cscope, but I couldn&#39;t find a way to find references to a field in<br>
&gt; a specific struct. Can this be done with cscope?<br>
&gt;<br>
&gt; baruch<br>
&gt;<br>
<br>
</div>In theory cscope f t (find text) can do it, but it won&#39;t be very<br>
efficient and my suffer from high rate of false positives.<br>
Per your requirements, I&#39;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>