ipodipad / cppcheclipse

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

cppcheclipse uses file names on command-line (instead of from file with --file-list) which limits the amount of files that can be used as input #57

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Generate a project with enough files.
2. run cppcheclipse on the root so that all files should be processed.

What is the expected output?
cppcheck should run normally.

What do you see instead? Please provide output
of the console view of cppcheclipse as well as the Eclipse error log.

Console view:
Command line: C:\Program Files (x86)\Cppcheck\cppcheck.exe 
--template={file};{line};{severity};{id};{message} -j 1 <a lot of files here>

Eclipse error log:
An internal error occurred during: "Running cppcheck".
java.lang.NullPointerException
    at com.googlecode.cppcheclipse.ui.Console.show(Console.java:116)
    at com.googlecode.cppcheclipse.ui.commands.RunCodeAnalysis$RunCodeAnalysisJob.runResource(RunCodeAnalysis.java:34)
    at com.googlecode.cppcheclipse.ui.commands.ResourceSelectionJob.run(ResourceSelectionJob.java:44)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What version of the cppcheclipse, cppcheck, Eclipse and Java are you using?

cppcheclipse 0.9.9
cppcheck 1.58
Eclipse Juno Service Release 1 (CDT 8.1.1)
Java 1.6.0_29

On what operating system?
Windows Vista x64 (SP2)

Please provide any additional information below.

cppcheck provides --file-list command-line parameter to circumvent this 
problem. But you'd need to generate a separate file list of the source files 
for running the command instead of providing them on the command-line.

Original issue reported on code.google.com by toni.hei...@gmail.com on 15 Feb 2013 at 1:45

GoogleCodeExporter commented 8 years ago
The null pointer exception from the error log is not really the cause, but 
rather a follow up error (it appears because the console cannot be opened 
correctly). That issue is already tracked in issue 54. Please provide me with 
the full console and error log as the real cause should have been logged before 
the null pointer exception.

Original comment by konra...@gmx.de on 17 Feb 2013 at 5:06

GoogleCodeExporter commented 8 years ago
How do I get full console and error log? The real cause is the too long 
command-line input.

Original comment by toni.hei...@gmail.com on 17 Feb 2013 at 10:28

GoogleCodeExporter commented 8 years ago
After selecting a directory in the eclipse navigator, then this should be 
passed to the executable.

The help information, when using cppcheck from a command line, states:

-->
If a directory is given instead of a filename, *.cpp, *.cxx, *.cc, *.c++, *.c,
*.tpp, and *.txx files are checked recursively from the given directory.
<--

However, when starting the executable from within Eclipse selecting a folder 
containing >3400 files lists each file individually and issues the error:

-->
CreateProcess error=206, The filename or extension is too long) Maybe more 
information is available in the console view.
<--

Original comment by Don...@gmail.com on 27 Jun 2013 at 10:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=327193 and 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.as
px for the relevant limits on Windows. It seems to be 32,768 characters.

Original comment by konra...@gmx.de on 26 Dec 2013 at 10:51

GoogleCodeExporter commented 8 years ago
For Unix systems have a look at that table: 
http://www.in-ulm.de/~mascheck/various/argmax/.
The workarounds could be:
a) pass complete directories instead of single filenames to cppcheck
b) use a separate file to give the filenames to check

a) has the drawback of also imposing a limit (in case there are a lot of 
directories or only some files are relevant within one directory)
b) has the drawback that another file needs to be created before cppcheck is 
launched (and afterwards deleted).

Original comment by konra...@gmx.de on 26 Dec 2013 at 10:57

GoogleCodeExporter commented 8 years ago
According to the help file of cppcheck 1.62 the list of files to be checked can 
also be provided on the stdin.

Original comment by konra...@gmx.de on 26 Dec 2013 at 11:04

GoogleCodeExporter commented 8 years ago

Original comment by konra...@gmx.de on 26 Dec 2013 at 3:36

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

Original comment by konra...@gmx.de on 26 Dec 2013 at 3:38

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

Original comment by konra...@gmx.de on 26 Dec 2013 at 4:51

GoogleCodeExporter commented 8 years ago
Update: This is already supported with Cppcheck in version 1.56.

Original comment by konra...@gmx.de on 1 Mar 2014 at 9:32