ipodipad / cppcheclipse

Automatically exported from code.google.com/p/cppcheclipse
0 stars 0 forks source link

Can't include files not in workspace directory #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. New makefile project with existing code ...
2. Add workspace include path via Project Properties->C/C++General->Paths and 
Symbols 
3. run cppcheclipse from interface

What is the expected output? 
I expect to see no error

What do you see instead?

== Running cppcheck at 2/14/13 12:18 PM ==
Command line: /usr/bin/cppcheck 
--template={file};{line};{severity};{id};{message} --enable=all --verbose 
--inconclusive --force --platform=unix32 --std=c99 --std=c++11 --std=posix -I 
/home/timowest/workspace_indigo_60870/i870_14/include -I 
/home/timowest/workspace_indigo_60870/cxxtest/usr/include/cxxtest -I 
/home/timowest/build-dev/usr/include --check-config test/src/tmwtarg.cpp 
test/src/tmw_test_channel.cpp test/src/tmw_test_104_channel.cpp 
test/src/test_tmw_application_context.cpp test/src/test_time.cpp 
test/src/test_data_store.cpp test/src/test_channel.cpp 
test/src/test_assert_handler.cpp test/src/test_104server_session.cpp 
test/src/shell.cpp test/src/server_shell_app.cpp test/src/server_shell.cpp 
test/src/s14data.cpp test/src/m14data.cpp test/src/kal_logger.cpp 
test/src/client_shell_controller.cpp test/src/client_shell_app.cpp 
test/src/client_shell.cpp src/tmwtarg.cpp src/tmw_i870_ssession_base.cpp 
src/tmw_i870_ssector_base.cpp src/tmw_i870_session_settings.cpp 
src/tmw_i870_session_base.cpp src/tmw_i870_redundancy_group.cpp 
src/tmw_i870_protocol.cpp src/tmw_i870_ft12_channel.cpp 
src/tmw_i870_channel.cpp src/tmw_i870_104_ssession.cpp 
src/tmw_i870_104_ssector.cpp src/tmw_i870_104_msession.cpp 
src/tmw_i870_104_msector.cpp src/tmw_i870_104_channel.cpp 
src/tmw_i870_101_ssession.cpp src/tmw_i870_101_ssector.cpp 
src/tmw_application_context.cpp src/session_data_store.cpp src/s14data.cpp 
src/m14data.cpp src/i870_data_store.cpp src/extern_dnp.cpp 
src/control_actterm_timer.cpp
cppcheck: warning: Couldn't find path given by -I 
'/home/timowest/workspace_indigo_60870/i870_14/include/'
cppcheck: warning: Couldn't find path given by -I 
'/home/timowest/workspace_indigo_60870/cxxtest/usr/include/cxxtest/'

Note - those paths above don't exist as they are "workspace paths" and exist in 
other locations on file system. Looks like the plugin is assuming that all 
workspace projects files exist in the workspace

 Please provide output
of the console view of cppcheclipse as well as the Eclipse error log.

see above

What version of the cppcheclipse, cppcheck, Eclipse and Java are you using?
0.9.9, 1.59, indigo, 1.6.0_26

On what operating system?
Linux

Please provide any additional information below.

Original issue reported on code.google.com by iondi...@gmail.com on 13 Feb 2013 at 11:32

GoogleCodeExporter commented 8 years ago
Additionally, changes to the workspace include directories settings are not 
propogated to cppcheclipse until the "Follow user-defined includes" is 
unchecked applied and then checked again.

Original comment by iondi...@gmail.com on 13 Feb 2013 at 11:52

GoogleCodeExporter commented 8 years ago
I cannot reproduce. I tried to include a linked folder as include directory and 
it was correctly resolved (i.e. the resolved link was given to cppcheck). Can 
you give the exact pathnames and what exactly you linked there as a path?

For the example above I would need to know what 
/home/timowest/workspace_indigo_60870/i870_14/include/ exactly is and where it 
could be found in the filesystem. Thanks.

Original comment by konra...@gmx.de on 2 Jan 2014 at 5:45

GoogleCodeExporter commented 8 years ago
Also changes to the include directories become effective immediately for me. 
Please include detailed steps how to reproduce this issue as well.

Original comment by konra...@gmx.de on 2 Jan 2014 at 5:51

GoogleCodeExporter commented 8 years ago
Addressing your comments in order, I did not use a linked folder, I added a 
workspace path to the Paths/Includes dialog for the CDT the exact path name I 
used was "/i870_s14/include" the path you see in the error 
/home/timowest/workspace_indigo_60870 is the top level path to the workspace. 

The i870_s14 "project" is not stored in the workspace directory as it is 
imported as an external makefile project.

I was able to recreate the issue using these steps, hopefully this is helpful

0. start eclipse
1. create new workspace at $HOME/workspace_test_cppcheck
2. add two projects to workspace using the CDT "Add Makefile project" from the 
directory $HOME/test_cpp_check/i870_14 and $HOME/test_cpp_check/i870_s14 
3. Run cppcheck with default settings resulting command line

Command line: /usr/bin/cppcheck 
--template={file};{line};{severity};{id};{message} -j 1 <snipped list of files>

4. Window->Preferences->C/C++->cppcheklipse->Settings set follow user defined 
includes to checked. Apply 

5. Go to i870_s14 project settings, set ccpcheclipse->Advanced Settings to 
"--check-config" 

6. Run cppcheck. command line results below
Command line: /usr/bin/cppcheck 
--template={file};{line};{severity};{id};{message} -j 1 --std=c++11 
--check-config <snipped list of files>

7. Project settings->C/C++ General->Paths and Symbols->Includes->Add
add to all configurations
add to all languages
is a workspace path, are all set to true, click workspace and select 
/i870_14/include (no 's' in this path) -> Apply changes

8. Run cppcheck on the i870_s14 project, resulting command line below. Note the 
workspace relative path has been concatenated with the actual workspace path, 
which is not the actual location of the project. 

Command line: /usr/bin/cppcheck 
--template={file};{line};{severity};{id};{message} -j 1 --std=c++11 -I 
/home/timowest/workspace_test_cppcheck/i870_14/include --check-config <snipped 
list of files>
cppcheck: warning: Couldn't find path given by -I 
'/home/timowest/workspace_test_cppcheck/i870_14/include/'

The issue about changes not being propogated might have been bogus, I might 
have been incorrectly assuming that the cppcheck console was erased on every 
run 

Original comment by iondi...@gmail.com on 6 Jan 2014 at 9:44

GoogleCodeExporter commented 8 years ago
I could reproduce and will come up with a fix for the next version.

Original comment by konra...@gmx.de on 1 Mar 2014 at 7:26

GoogleCodeExporter commented 8 years ago

Original comment by konra...@gmx.de on 1 Mar 2014 at 7:26

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r306.

Original comment by konra...@gmx.de on 1 Mar 2014 at 8:00