Re: [cedet-semantic] How the includes statements in a cpp project are analyzed by semantic
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2013-05-16 01:54:15
|
Hi Pamela, I'm glad you figured out what was going on with your includes. In C or C++, an include of the form: #include <file.h> is for system includes. They would be found in the list of paths listed in the ede-cpp-root-project's :system-include-path slot. Includes of the form: #include "file.h" is for includes not on the system include path, but perhaps local to the file being compiled, or in a project include path. These would be in the :include-path slot of your project. I think Semantic may be a bit overly pedantic on this distinction, as compilers seem willing to take whatever it can find. If you code is using the wrong kind of #include brackets you can compensate by populating different slots in your EDE project, though the system include path can't do the same filename expansion as described for the :include-path slot. http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html The patch I attached might 'fix' the problem for you, but it is better to use the right kind of include. Eric On 05/14/2013 04:28 AM, Pamela Carreño wrote: > Hi, > > last week I had some problems with semantic and the include statements > in my .cpp and .h files, many of the includes were not being found and > analyzed by semantics > > After several tries I noticed that after changing from #include > <statement> to the respective #include "statement", everything started > to work as expected. Is this a normal behavior? Or maybe is it related > to how I defined the project using ede-cpp-root-project? > > My definition is: > > /(ede-cpp-root-project "FLANN"/ > / :name "Flann1.8"/ > / :file > "/home/carrenom/Documents/PhD/Code/Kd-Trees_NNS/Flann/CMakeLists.txt"/ > / :include-path '("/test"/ > / "/examples"/ > / "/src/cpp/flann"/ > / "/src/cpp/flann/algorithms"/ > / "/src/cpp/flann/io"/ > / "/src/cpp/flann/mpi"/ > / "/src/cpp/flann/nn"/ > / "/src/cpp/flann/util"/ > / )/ > / :system-include-path '("/usr/include/" > "/usr/include/c++/4.7/")/ > / :spp-table '(("isUnix" . "")/ > / ("BOOST_TEST_DYN_LINK" . "")))/ > > > An example of the behaviour I am talking about > > ///#include <flann/flann.h> NOT OK TO SEMANTIC/ > ///#include <flann/io/hdf5.h> NOT OK TO SEMANTIC/ > /#include "../src/cpp/flann/flann.h" OK TO SEMANTIC/ > /#include "../src/cpp/flann/io/hdf5.h" OK TO SEMANTIC/ > > > Also I would like to know how semantic visits and analyze all the > includes in the source code. > > Regards, > > Pamela Carreno > > > > ------------------------------------------------------------------------------ > AlienVault Unified Security Management (USM) platform delivers complete > security visibility with the essential security capabilities. Easily and > efficiently configure, manage, and operate all of your security controls > from a single console and one unified framework. Download a free trial. > http://p.sf.net/sfu/alienvault_d2d > > > > _______________________________________________ > cedet-semantic mailing list > ced...@li... > https://lists.sourceforge.net/lists/listinfo/cedet-semantic |