Code Monkey home page Code Monkey logo

cppcheck-vs-addin's Introduction

Hi!

I'm a software engineer, and this is where my pet projects live. Mostly interested in C++, but explore other tools when they fit the job better.

  • Currently working on a toy C++ database / storage engine for my potential future web search engine project.
  • I also maintain my own cross-platform (Win / Linux / Mac) dual-panel file manager.
  • I don't fork other people's repos just for the sake of forking, all the projects in my profile are either my own or I have contributed to them.

My blog posts

cppcheck-vs-addin's People

Contributors

2xmax avatar altren avatar amai2012 avatar chumakovs avatar dmitry-me avatar graemekelly avatar icnocop avatar jimkeir avatar kinglike1337 avatar lederernc avatar m5knt avatar mkurdej avatar mloskot avatar mrgreywater avatar playmyskay avatar quatmax avatar t-johnson avatar violetgiraffe avatar x29a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cppcheck-vs-addin's Issues

Settings pane managed in suspicious manner

If I ask to display cppcheck settings and then with the pane open ask again I now have two panes. Each time a pane is crafted there's a cppcheck.exe run. Why isn't the pane just cached and reused?

What has to be done before introducing the plugin to wide public

I'm thinking of polishing the project a little bit and asking cppcheck developers to feature it on the cppcheck's main page (which currently says there is no VS plugin). What has to be done before that:

  • The terrible "settings" window either has to go or needs serious work. I merely used it for runtime customization as opposed to hard-coding command line arguments etc. It might be useful at that, but needs cleanup.
  • I want to make separate project file folders with projects for VS2010 / 2012 / 2013 referring to the same sources but with appropriately different settings. Then we can also provide built packages for these 2 major VS version, so users won't need to download SDK etc.

Any other ideas?

Any objections against using "--relative-paths" command line switch?

Starting with version 1.54 (http://sourceforge.net/apps/trac/cppcheck/milestone/1.54) there's "--relative-paths" command line options that makes cppcheck output file paths relative to a specified base (presumably project root). If the file is above project root an absolute path seems to be output.

This makes the output more or less similar to what the compiler outputs - neat short filenames instead of long paths. Clicking onto the output line still makes the editor scroll to the right piece of code.

Is there any reason why this is not needed as default behavior?

Per-file settings ignored

Visual Studio allows changing compilation settings per file - select a .cpp or .c file in Solution Explorer and for example add a new preprocessor symbols. If you look at the command line it's clear that the per-file settings are ignored both for "check whole project" and for "check current file".

Suggestions for new-style results window

The results seem to be working quite nicely.

  1. Could you consider using smaller Severity icons? Because they are taller than 1 line of text I now see fewer messages in the same size window than before.
  2. I really would like to have columns for the file name and line number.

Supresisons file for whole solution.

Since projects in one solution usually follow same coding style rules it would be nice to be able to suppress warnings for all projects in given solution.

Implementation could be simpe: use same suppressions.cfg file, but put it near solution file (also I think that adding project name to file name would be important to avoid conflicts when solution and project file are in same folder or several project files in same folder).
The only problem I see is how to make it usable in gui. Variants are:

  • add checkbox in settings that would make suppressions.cfg be used per solution instead of per project;
  • add popup menu items "Suppress this <...> for whole solution."

Both variants far from perfects so ideas are welcome.

Enhancement Request: Additional changes to Settings Dialogs

As raised in problem #74, I would like a few more features regarding Settings if possible please.

I know there has been a recent improvement (commit 787185d) but may I ask for more :-)

  1. Could the initial dialog be a bit bigger - the checkboxes are much too close together?
  2. Could this dialog also have the "OK" and "Cancel" buttons?
  3. Could the state of settings of 4 checkboxes at the top of the dialog be remembered?
  4. The previous very busy dialog had a very large number of possible settings set. I expect that they are still set but they don't appear in the new settings child dialogs in any of the panels. If they are set, can all current non-default options, be shown in these child dialogs?
  5. Although there is now an option to add libraries to be excluded, could the panel into which they can be added be pre-populated with all the current solution/project's include libraries? I would prefer that they had a checkbox against each one so that the user can easily exclude or include them without deleting any from the list or, if not, then an option to reset to include all the current solution/project's include library in case a user had previously removed some (the reset should not delete any extra ones included by the user - just those from the project files).

Even though I have looked at the code for this commit and I am not sure how to specify exclude libraries in that panel. Help on this would be appreciated.

As an aside, looking at this commit, I notice a large number of Qt libraries. Not that I use Qt, but couldn't most be replaced by one entry of the form of something like: \include\Qt.*"?

PS. Many thanks re problem #74. I have finally fixed the mess of our configuration in the solution and project files.

David

When saving multiple files can we reduce the message boxes?

When working through a cppcheck report, one often has multiple dirty files that you wouold like to build to check that the changes have not broken anything. However, you do not want to disturb the cppcheck results (which may have taken a lot of time to generate).

It is good that you get a dialog to warn of the potential loss of the old results, but it is a PITA to be asked for every file. Also, it would be good for the dialog box to state which file is being written with the option to skip the check for any other files that are to be saved... Of course, if VS only tells you about this file by file you may need to use the time of the box display to determine what to do... Of course, if you know about all the files, then you could offer to check them all, or to check none.

Enhancement: allow to select cppcheck options.

Allow a bunch of checkboxes to choose between next options: style,information,warning,performance,portability,error. For good descriptions for tooltips look here: https://github.com/danmar/cppcheck/blob/9ab6655d85d009cb1c0f30b2fe228f1a3c7714c9/lib/errorlogger.h

Also it would be important to change suppressions list (simple set of checkboxes for every supression option would be enough). Unfortunately I haven't found complete list of possible suppressions and it seems that there is no complete list of those. If you want I can spend some time and create complete list of possible messages with suppression code and detailed description (collect all this from cppcheck code).

Add support for VS2010?

Any plans to support this plugin for VS2010?

When I run the .vsix, I get an error:
The extension manifest is invalid.

Settings window is too large to fit

I'm running Windows 7 at 1280*1024 resolution with 125% sized fonts. When I ask to show the cppcheck settings window it appears in the area that starts from where the Visual Studio toolbar ends and spans well below the taskbar. If I drag it with mouse to the top of the screen the last thing I can access is "passing result of c_str()" in the "performance" section.

I'd guess the window should detect the size of Visual Studio main window, check if it fits in there and perhaps shrink to fit and enable scrolling. This will hardly be the best UI ever, but still quite usable.

Traffic graph reports numerous requests to the /releases path

I looked into the traffic graph and the number one page requested is "https://github.com/VioletGiraffe/cppcheck-vs-addin/releases/tag/1.0.1" (release 1.0.2 has just appeared), the second one is the project start page and the third one is https://github.com/VioletGiraffe/cppcheck-vs-addin/releases I'd guess the third one is from http://cppcheck.sourceforge.net/ - they link to /releases which means the user who most likely wanted to "emmm, whatever, just get the latest version" has to see the list of releases and make an effort to choose the latest one. The link should be to https://github.com/VioletGiraffe/cppcheck-vs-addin/releases/latest instead.
@VioletGiraffe, could you please ask Cppcheck owners to alter the link?

"save all" is handled incorrectly when two or more files are unsaved

Currently if two or more source files have been edited and not yet saved and "save all" is pressed the documentSaved() handler is invoked once for each of the files and so only the last file analysis output gets displayed in the output window and all other files analysis output is lost. No idea how to fix this at the moment.

Warnings when building project (21-Feb-2014)

c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(28): warning : CA2214 : Microsoft.Usage : 'MainToolWindow.MainToolWindow()' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences:
c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(28): warning :
c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(28): warning : MainToolWindow..ctor()
c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(28): warning : ToolWindowPane.set_Caption(String):Void
c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(28): warning : WindowPane.set_Content(Object):Void
Code Analysis Complete -- 0 error(s), 1 warning(s)

Wrong flag being taken into account when project with one file is checked

AnalyzerCppcheck.analyze() contains the following line:

if ((filesToAnalyze.Count == 1 && Properties.Settings.Default.FileOnlyCheckCurrentConfig) || (filesToAnalyze.Count > 1 && Properties.Settings.Default.ProjectOnlyCheckCurrentConfig)) // Only checking current macros configuration (for speed)

and if the project contains one source file only the first condition evaluates to true and so the FileOnlyCheckCurrentConfig setting is taken into account instead of ProjectOnlyCheckCurrentConfig.

Exlude some include paths by default.

With including all this visual studio headers by default checks goes very slow while getting little profit from those. Same for included boost/qt/other huge libraries headers.

What I suggest is to exclude those by default in global suppressions. User would be able to remove those exclusions, but right now many users think that plugin simply doesn't work rather than work very slow (f.e. checks with boost included might take few hours to complete).

Add a way to cancel analysis.

It would be nice to be able to cancel an analysis in progress. I have various sized projects in my solution and I accidentally started checking the wrong one that takes a very long to complete. I couldn't see any way to stop it.

Parameter incorrect (Exception from HRESULT 0x80070057 (E_INVALIDARG))

This plugin was working fine in VS2012 until I opened another instance of it and then tried to run the plugin in the second one on a different project. Now I get this all the time - even after a PC restart.
However, I could be mistaken in that this wasn't the cause.
Deleting the files in %LocalAppData%\Microsoft\VisualStudio\11.0\Extensions and re-installing didn't fix it.
I don't know how to properly remove this plugin completely and start again (deleting the files still left the menu items).

"System.Windows.Data Error" messages in debug output window

I start Visual Studio 2012, open a project and see the following line in debug output window:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=col1'. BindingExpression:Path=ActualWidth; DataItem=null; target element is 'ColumnDefinition' (HashCode=41311375); target property is 'Width' (type 'GridLength')

then I select "check current project" and the following line appears in debug output:

System.Windows.Data Error: 40 : BindingExpression path error: 'selectedItem' property not found on 'object' ''ToolWindowView' (HashCode=19415056)'. BindingExpression:Path=selectedItem; DataItem='ToolWindowView' (HashCode=19415056); target element is 'ListView' (Name='listView'); target property is 'SelectedItem' (type 'Object')

other than that it looks working just fine. No idea what these messages mean.

Unmatched suppression

At the end of the output I get:
*(0): information: Unmatched suppression: constStatement
*(0): information: Unmatched suppression: missingInclude
*(0): information: Unmatched suppression: missingIncludeSystem
*(0): information: Unmatched suppression: passedByValue

I guess that these are either misspellings or flags that cppcheck does not (yet?) know about.

Weird additional arguments textbox behavior.

TextBox for additional arguments works fine only when VisualStudio have no source files opened or solution tree have focus. Otherwise textbox behaves next way: characters keys work just fine, but most other keys goes to currently focused panel in visual studio, so f.e. you can print something in textbox, but when you press delete or backspace it affect code instead (same for arrows, Ctrl+ ... combinations)

I spent a while trying to find a solution for this issue, but still have no idea what's going on. Hope someone else can look at it.

Format Exception in 26/Feb code

I get:
FormatException was unhandled. Input string was not in a correct format.

in protected override List parseOutput(String output) at
list.Add(new Problem(severity, parsed[3], parsed[4], parsed[0], Int32.Parse(parsed[1]), _projectBasePath));
parsed [0] and [1] are empty,
[2] = "information"
[3]="missingInclude"
[4]="explanation..."

possibly calling int32.Parse() on an empty string is not a good idea?

Have you run code analysis on the solution recently. I get:
1>c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\ICodeAnalyzer.cs(143): warning : CA2202 : Microsoft.Usage : Object 'process' can be disposed more than once in method 'ICodeAnalyzer.analyzerThreadFunc(string, string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 143
1>c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(86): warning : CA2214 : Microsoft.Usage : 'MainToolWindow.MainToolWindow()' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences:
1>c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(86): warning :
1>c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(86): warning : MainToolWindow..ctor()
1>c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(86): warning : ToolWindowPane.set_Caption(String):Void
1>c:\GitStuff\cppcheck-vs-addin\CPPCheckPlugin\MainToolWindow.cs(86): warning : WindowPane.set_Content(Object):Void
1>MSBUILD : warning : CA1009 : Microsoft.Design : Declare the first parameter of 'MainToolWindowUI.openProblemInEditor' as an object named 'sender'.
1>MSBUILD : warning : CA1009 : Microsoft.Design : Declare the second parameter of 'MainToolWindowUI.openProblemInEditor' as an EventArgs, or an instance of a type that extends EventArgs, named 'e'.
1>MSBUILD : warning : CA1009 : Microsoft.Design : Declare the first parameter of 'MainToolWindowUI.suppresssionRequestedHandler' as an object named 'sender'.
1>MSBUILD : warning : CA1009 : Microsoft.Design : Declare the second parameter of 'MainToolWindowUI.suppresssionRequestedHandler' as an EventArgs, or an instance of a type that extends EventArgs, named 'e'.

No analyser output with 11/March code

Having updated to the latest sources I no longer get any output in the Cppcheck analysis results or the Output cppcheckl analysis output (though I do see the command line there).

Also, have you changed the version number in the manifest... each time I install it I see that the version is now 1.0.5 (I was used to seeing 1.0.4)? The CppCheck settings... command does open the dialog with all the suppression settings, so I don't think I am getting the released 1.0.5 version installed.

Make the cppcheck output window visible on running check

If the cppcheck output windows is not the selected Output window, you get no visual confirmation that the cppcheck command has been actioned. If the Output window is visible you should select the relevant cppcheck window. I'm not sure if the standard practice in VS is to make the Output window visible if there is output from a command... yes it appears it is, so you should also do this.

command line has -D -DWIN32 causing fail

For a particular project in a solution for which another project works, the command line generated is:

Starting analyzer with arguments: --enable=style,information,warning,performance,portability --inline-suppr -q --force --template=vs --relative-paths="C:\HgWork\Spike8\son64\tson64tst" -j 8 --suppress=passedByValue --suppress=cstyleCast --suppress=missingIncludeSystem --suppress=unusedStructMember --suppress=unmatchedSuppression --suppress=class_X_Y --suppress=missingInclude --suppress=constStatement --suppress=unusedPrivateFunction "C:\HgWork\Spike8\son64\tson64tst\test.cpp" -D__cplusplus=199711L -D_MSC_VER=1900 -D -DWIN32 -D_WIN32 -D_M_IX86 -D_DEBUG
cppcheck: argument to '-D' is missing.
c:\Program Files (x86)\Cppcheck\cppcheck.exe has exited with code 1

I cannot see where the blank name is coming from; can I suggest that you filter blank names out (maybe with a hint of their source as a message?).

Enhancement: check box for --check-config

I have problems with cppcheck that are probably due to #include files not being seen. If I turn on the options to be told about missing include files I get:
(): information: Cppcheck cannot find all the include files (use --check-config for details)

So, either turn this on automatically if the include file options are selected or make this an additional option.

Do we need a contributors guide yet?

I thought maybe we need a short contributors guide already. Something like how to make Visual Studio run the right version of Visual Studio and which Visual Studio SDK to install. Anything else perhaps?

Why is --force set?

Now that we have the exact configuration of predefined macros read from the configuration of the current project, it seems somewhat perverse (to me) to use --force to make all possible combinations of undefined macros be analysed.

Ideally, what I want is to check things exactly as the compiler would see it for the current configuration... or at least have this as an option.

The fact that I get every possible combination causes lots of warnings that are not real, resulting in a lot of noise in the output (not to mention head scratching to work out how on earth the warnings could happen).

Suspicious code in SourceFile constructor

SourceFile constructor contains a chain of _if_s checking the value of vcCompilerName variable which comes from the calling function where it is read from PlatformToolsetShortName property. The default yields VCCompilerVersion.vcFuture enum value.

The deal is I'm using Visual Studio 2012 on some project created from "Win32 Console Application" template and for both .cpp and .c files this value happens to be an empty string which upon getting into that chained if yields VCCompilerVersion.vcFuture.

Not sure what the impact is.

There is no --enable parameter with the name 'error'

Latest committed version run with on my project now gives:

Starting analyzer with arguments: --inline-suppr -q --force --template=vs --enable=style,information,warning,performance,portability,error --relative-paths="C:\HgWork\Spike8\SpikeUtl" -j 8 --suppress=passedByValue --suppress=cstyleCast --suppress=missingIncludeSystem --suppress=unusedStructMember --suppress=unmatchedSuppression --suppress=class_X_Y --suppress=missingInclude --suppress=constStatement --suppress=unusedPrivateFunction -I"C:\HgWork\Spike8" -I"C:\HgWork\Spike8\compiler" -I"C:\HgWork\Spike8\runtime" -I"C:\HgWork\Spike8\spikecmd" -I"C:\HgWork\Spike8\sonlayer" -I"C:\HgWork\Spike8\son64" -I"C:\HgWork\Spike8\use1432" "C:\HgWork\Spike8\SpikeUtl\abortd.cpp" "C:\HgWork\Spike8\SpikeUtl\accessdb.cpp" "C:\HgWork\Spike8\SpikeUtl\allowmgr.cpp" "C:\HgWork\Spike8\SpikeUtl\avifile.cpp" "C:\HgWork\Spike8\SpikeUtl\axis.cpp" "C:\HgWork\Spike8\SpikeUtl\beta.cpp" "C:\HgWork\Spike8\SpikeUtl\breaklst.cpp" "C:\HgWork\Spike8\SpikeUtl\brent.cpp" "C:\HgWork\Spike8\SpikeUtl\cbutman.cpp" "C:\HgWork\Spike8\SpikeUtl\ccodebar.cpp" "C:\HgWork\Spike8\SpikeUtl\ccursor.cpp" "C:\HgWork\Spike8\SpikeUtl\cedresf.cpp" "C:\HgWork\Spike8\SpikeUtl\chbutscr.cpp" "C:\HgWork\Spike8\SpikeUtl\cintbar.cpp" "C:\HgWork\Spike8\SpikeUtl\cmatrix.cpp" "C:\HgWork\Spike8\SpikeUtl\cmpparam.cpp" "C:\HgWork\Spike8\SpikeUtl\cmrbbut.cpp" "C:\HgWork\Spike8\SpikeUtl\cobjtype.cpp" "C:\HgWork\Spike8\SpikeUtl\complex.cpp" "C:\HgWork\Spike8\SpikeUtl\conscrip.cpp" "C:\HgWork\Spike8\SpikeUtl\csheet.cpp" "C:\HgWork\Spike8\SpikeUtl\cstr.cpp" "C:\HgWork\Spike8\SpikeUtl\ctagcurs.cpp" "C:\HgWork\Spike8\SpikeUtl\cuspline.cpp" "C:\HgWork\Spike8\SpikeUtl\dbl2char.cpp" "C:\HgWork\Spike8\SpikeUtl\dblconv\bignum-dtoa.cc" "C:\HgWork\Spike8\SpikeUtl\dblconv\bignum.cc" "C:\HgWork\Spike8\SpikeUtl\dblconv\cached-powers.cc" "C:\HgWork\Spike8\SpikeUtl\dblconv\diy-fp.cc" "C:\HgWork\Spike8\SpikeUtl\dblconv\double-conversion.cc" "C:\HgWork\Spike8\SpikeUtl\dblconv\fast-dtoa.cc" "C:\HgWork\Spike8\SpikeUtl\dblconv\fixed-dtoa.cc" "C:\HgWork\Spike8\SpikeUtl\dblconv\strtod.cc" "C:\HgWork\Spike8\SpikeUtl\debugscr.cpp" "C:\HgWork\Spike8\SpikeUtl\defer.cpp" "C:\HgWork\Spike8\SpikeUtl\errorm.cpp" "C:\HgWork\Spike8\SpikeUtl\fftarith.cpp" "C:\HgWork\Spike8\SpikeUtl\fftwind.cpp" "C:\HgWork\Spike8\SpikeUtl\fit.cpp" "C:\HgWork\Spike8\SpikeUtl\gamma.cpp" "C:\HgWork\Spike8\SpikeUtl\gridview.cpp" "C:\HgWork\Spike8\SpikeUtl\iirapply.cpp" "C:\HgWork\Spike8\SpikeUtl\iirgen.cpp" "C:\HgWork\Spike8\SpikeUtl\include.cpp" "C:\HgWork\Spike8\SpikeUtl\invalbin.cpp" "C:\HgWork\Spike8\SpikeUtl\linpred.cpp" "C:\HgWork\Spike8\SpikeUtl\memdc.cpp" "C:\HgWork\Spike8\SpikeUtl\mfcaxis.cpp" "C:\HgWork\Spike8\SpikeUtl\moddlg.cpp" "C:\HgWork\Spike8\SpikeUtl\nlf.cpp" "C:\HgWork\Spike8\SpikeUtl\progdlg.cpp" "C:\HgWork\Spike8\SpikeUtl\pulctab.cpp" "C:\HgWork\Spike8\SpikeUtl\pulseman.cpp" "C:\HgWork\Spike8\SpikeUtl\rand.cpp" "C:\HgWork\Spike8\SpikeUtl\reschan.cpp" "C:\HgWork\Spike8\SpikeUtl\scictrl.cpp" "C:\HgWork\Spike8\SpikeUtl\sequence.cpp" "C:\HgWork\Spike8\SpikeUtl\showerr.cpp" "C:\HgWork\Spike8\SpikeUtl\simplex.cpp" "C:\HgWork\Spike8\SpikeUtl\smpparse.cpp" "C:\HgWork\Spike8\SpikeUtl\spikeutl.cpp" "C:\HgWork\Spike8\SpikeUtl\spkbar.cpp" "C:\HgWork\Spike8\SpikeUtl\stdafx.cpp" "C:\HgWork\Spike8\SpikeUtl\stringho.cpp" "C:\HgWork\Spike8\SpikeUtl\svd.cpp" "C:\HgWork\Spike8\SpikeUtl\temphold.cpp" "C:\HgWork\Spike8\SpikeUtl\template.cpp" "C:\HgWork\Spike8\SpikeUtl\theme.cpp" "C:\HgWork\Spike8\SpikeUtl\timescr.cpp" "C:\HgWork\Spike8\SpikeUtl\tipcbox.cpp" "C:\HgWork\Spike8\SpikeUtl\typedesc.cpp" "C:\HgWork\Spike8\SpikeUtl\t_test.cpp" "C:\HgWork\Spike8\SpikeUtl\vararray.cpp" "C:\HgWork\Spike8\SpikeUtl\xml.cpp"
c:\Program Files (x86)\Cppcheck\cppcheck.exe has exited with code 1
cppcheck: there is no --enable parameter with the name 'error'

I don't see error in the documentation for cppcheck... maybe it is always enabled!

COMException with E_UNEXPECTED code when a new project is being created

Here's the repro: in Visual Studio 2012 I start with no solution opened and then use File -> New -> Project, there I select Visual C++ -> Win32 Console Application, click through and for every newly created source file of the new project I have documentSaved() invoked and it yields COMException with E_UNEXPECTED error code when trying to obtain document.ProjectItem. Each time the exception is catched by the catch and logged into the output but because the output is cleared before the next exception is logged there's only one record.
I'm not sure how to fix this but it looks like in this case every document has ActiveWindow set to null and when I edit a file and save it the same handler is invoked with ActiveWindow being not null. So I guess this can be used to detect and ignore those "first time" saves.

Environment variables are not expanded

If one puts an environment variable in include paths, it does not get expanded before being passed to cppcheck.

Due to the way our environment is set up, I have the path $(SourceRoot)\External\H in my include path (among others). This gets expanded into D:\Perforce\Dev\Projects\Vs2012\$(SourceRoot)\External\H, making cppcheck output this in its output window:

Starting analyzer with arguments: --enable=style,information,warning,performance,portability --inline-suppr -q --force --template=vs --relative-paths="D:\Perforce\Dev\Projects\Vs2012" -j 8 --suppress=passedByValue --suppress=cstyleCast --suppress=missingIncludeSystem --suppress=unusedStructMember --suppress=unmatchedSuppression --suppress=class_X_Y --suppress=missingInclude --suppress=constStatement --suppress=unusedPrivateFunction  -I"D:\Perforce\Dev\Projects\Vs2012\$(SourceRoot)\External\H" "D:\Perforce\Dev\Source\HwLighting\HwLighting.cpp" -D__cplusplus=199711L -D_MSC_VER=1900 -DWIN32 -D_WINDOWS -DPLATFORM_WINDOWS -DPROJECT_GW2 -D_DEBUG -DLOCALIZE -DCLIENT -DCLIENT_BUILD -DSERVER -DSERVER_BUILD -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -D_ALLOW_RUNTIME_LIBRARY_MISMATCH -D_WIN32 -D_M_IX86
cppcheck: warning: Couldn't find path given by -I 'D:\Perforce\Dev\Projects\Vs2012\$(SourceRoot)\External\H\'
Analysis completed in 0.038 seconds

Plugin failure: "Object reference not set to an instance of an object"

The plugin (version 1.0.4 and earlier versions) does not work for me:
"Object reference not set to an instance of an object" (actually I use German language version: "Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt"). It is VS 2012 Professional, Update 4 on Windows 7.
The settings dialog is available, but "check current project with cppcheck" always triggers this error message.

1.0.6 release

I think we are ready for next release. I think that all parts are enough solid and stable.

The only issue that may be need to be resolved before release is #78.

Possibility to check whole solution.

It would be nice to have possibility to check whole solution, because checking each project is tedious, and everywhere I worked solutions had more than few projects in them.

MSVC-style include not supported by cppcheck?

I have been struggling to explain why in our projects we have problems with cppcheck not being able to find some #included files. I think I now know why this happens.

We have a main program in folder \main and this then has sub-projects (dlls) in sub-folders \main\dll1, \main\dll2 and so on. Each project (main and dll1, dll2...) has a list of folders to search for include files; the sub-projects list the main program folder.

Our problem is that we rely on the MSVC "non-standard" search order of #include "file1.h" as we have include files in sub-projects that include files in the \main forder as

include "mainfolderfile.h"

This works in the subproject as we explicitly name \main as an include for the sub-project configuration and it works in the main program because of the MSVC search order (which searches the tree of opened included files) as well as the folder of the current include file and any -I folders.

Is there a way to tell cppcheck to use the MSVC #include rules? If not, can we have an option to add the same path as you define for the relative path as an -I path?

I know I can fix this by changing the way we refer to files in #include, but this would be messy as some of the sub-projects are used by other projects.

String.Replace() used incorrectly has no effect

AnalyzerCppCheck.analyze() currently has this code:

 if ((filesToAnalyze.Count == 1 && Properties.Settings.Default.FileOnlyCheckCurrentConfig) || (filesToAnalyze.Count > 1 && Properties.Settings.Default.ProjectOnlyCheckCurrentConfig)) // Only checking current macros configuration (for speed)
{
    cppheckargs.Replace("--force", "");

and Code Analysis emits CA1806 warning for the Replace() saying the return value should be used. It looks like the variable is not changed by this line and the whole line has no effect.

Installation over previous version

I am working with the git repo latest master and building the project to a vsix file. When I double-click this file to install it I am always told that it is already installed, so I have to go to VS2012 and VS2013 and uninstall it. Also, it is coming up as version 1.0.4 when it is installed, even though there is a tag in the project for 1.0.5.

Is this an issue with version numbers? Is there any way to make the extension install regardless or is this just the inevitable result of using bleeding edge revisions.

Bugs in 25/Feb git version

If you use the CppCheck Settings menu, close the settings window, then use the CppCheck Settings menu command again you get: "Cannot set Visibility or call Show, ShowDialog, or WindowInteropHelper.EnsureHandle after a Window has closed"

The template set is no longer correct for VS2012 as it is using vertical bars to separate the fields. The standard format is (for example):
path\to\file.cpp(line): error C2065:: 'name' : undeclared identifier

Inherited project settings are not used.

Settings, inherited from property sheets are not used during check.
Include directories and preprocessor definitions should be added to other includes.

F.e. I use boost propertysheet in all projects to not specify path to boost in each.

Exiting Visual Studio is not properly handled

Currently the following sequence: open a large project, ask to check it with cppcheck, then exit Visual Studio before analysis finishes - leaves cppcheck.exe running and also sometimes the analyzerOutputHandler() will be invoked with Visual Studio in the middle of exiting which triggers an exception inside OutputString() method of the output pane object. Same if Visual Studio crashes in the middle of nowhere while cppcheck.exe is running.
The following likely needs to be done to resolve this:

  1. override Dispose() method of the Package class
  2. in the the DIspose override make the "analyzer" call Abort() on the thread if any (this will cause the cppcheck.exe process to be forcibly terminated) and also unsubscribe from the events.
    Not sure if it's necessary to remove the commands from the main menu.
  3. looks like the best bet is to use Windows "job objects" via P/Invoke which can be attached to child processes so that when the parent process exits for whatever reason Windows takes care of the child process.

Incorrect additional include paths usage (missing "\" between concatenated paths).

I have next string in additional include paths:

application;..;..\include

but what I see in log is that those paths are concantenated with project's path without ending "":

cppcheck: warning: Couldn't find path given by -I 'D:\The Far Wilds\tfw\island2\us\clientcoreapplication\'
cppcheck: warning: Couldn't find path given by -I 'D:\The Far Wilds\tfw\island2\us\clientcore..\'
cppcheck: warning: Couldn't find path given by -I 'D:\The Far Wilds\tfw\island2\us\clientcore..\include\'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.