Cppcheck-1.66

Cppcheck-1.66 has been released.

New checks:
- Compare pointer with '\0'
- Assigning boolean expression to floating point variables

Improvements:
- Much improved AST
- Much improved ValueFlow analysis
- ValueFlow and AST now used by much more checks, improving checking accuracy and performance
- Checking for self assignment now supports more complex expressions
- Returning references to literals or references to calculation results is detected
- Enhanced support for commutative operators in duplicate expression checking
- Improved template/enum parsing
- Much improved htmlreport
- Definition of POD types in .cfg files
- Definition of minsize for buffer arguments in .cfg files for buffer overflow checking
- Fixed handling of #error: Do not report them if -f and -D are used together
- New .cfg file for AVR platform
- Generate xml dump of AST/ValueFlow/SymbolDatabase/TokenList if --dump is given
- Improved performance in several cases
- Windows Builds: Now compiled with VS2013, linked against Qt 5.3.1

GUI:
- Platform settings are being saved now
- Improved handling of (invalid) .cfg files
- Use Win32W as default platform on Windows

Additionally, a large number of false positives and crashs has been fixed.

Posted by Daniel Marjamäki 2014-08-02
  • w-peuker

    w-peuker - 2014-08-04

    Great news! I especially like the new(?) virtualDestructor check. Why is it inconclusive?

     
    • Daniel Marjamäki

      I especially like the new(?) virtualDestructor check. Why is it inconclusive?

      The reason is that the destructor only needs to be virtual if a derived class with a non-empty destructor is deleted using a base class pointer.

      This warning is inconclusive because the check does not try to determine if that happens.

       
      • w-peuker

        w-peuker - 2014-08-04

        the destructor only needs to be virtual if a derived class with a non-empty destructor is deleted using a base class pointer

        You are absolutely right. But issues that are (kind of) "prepared" by this argument are at least leaks, sometimes catastrophic errors. And they may be hard to detect. And I came to the conclusion, that another argument works better: if there is already a VTBL, a virtual destructor is relatively cheap. The presence of virtual functions (especially pure ones) indicate that there will be inheritance... ...and sometimes also derived destructor calls.

        Regardless whether inconclusive or not: many thanks for this new check! :)

         
  • Bassam Abdul-Baki

    Minor issues between this version and the previous one. In this version, I had to manually download msvcp120.dll and msvcr120.dll since they were not available on my non-development machine. In addition, the GUI version still will not run and gives me the following error:



    cppcheckgui


    This application failed to start because it could not find or load the Qt platform plugin "windows".

    Reinstalling the application may fix this problem.



    OK


    Problem Solved

    Don't have admin rights on this machine, so installing the MSI was never an option.

    This solution is for anyone who uses this without admin rights.

    Unzip the MSI file somewhere and rename all DLLs as applicable. The three files with msvcp120, msvcr120, and vccorlib120 are also DLLs. The latter not currently sure what the use of is. The issue with the GUI was solved by creating a "platforms" folder under the executable folder and moving qwindows.dll there.

    Thanks,
    Bassam

     
    Last edit: Bassam Abdul-Baki 2014-08-04
  • w-peuker

    w-peuker - 2014-08-04

    Today I tried to file an issue, but I found that my Sourceforge login no longer works on the Cppcheck Trac instance. When and why has this changed?

     
    • Daniel Marjamäki

       
      • w-peuker

        w-peuker - 2014-08-05

        I read in the wiki about registering an account - May I send you my htpasswd string via e-mail as well?

         
        • Daniel Marjamäki

          sure

           
          • 00bins

            00bins - 2014-09-12

            Hi

            I'd like to contribute / submit a trac report but don't seem to be able to create an account - what do I need to do?

            thanks
            Rob

             
  • w-peuker

    w-peuker - 2014-08-05

    (please ignore/delete: was a misplaced reply)

     
    Last edit: w-peuker 2014-08-05
  • frithjofh

    frithjofh - 2014-08-13

    Hello Daniel,

    I just have a question regarding a feature you added to cppcheck some time ago on request of one of the developers of the code::blocks ide.

    The particular feature is the possibility to give a file with a line wise list of the files to be checked by cppcheck using --file-list=<file> parameter.

    My question is if the sorting of the files in the list does have any noticeable effect on the execution time of cppcheck? Like if it will execute faster if in the list first come all header files and then all the source files... or any other sorting.

    Thanks in advance

     
    Last edit: frithjofh 2014-08-13
  • Daniel Marjamäki

    I recommend that you don't put headers in the --file-list. Use #include to include them from your source files - then they will be analysed properly. The order should have no impact on performance as far as I see. I don't know if it makes any real difference but if you use multithreaded checking it could be best if the smallest files are checked last (to avoid that cores are idle in the end while a single core finish checking the large file).

     
  • frithjofh

    frithjofh - 2014-08-13

    Thanks for the quick answer. The hint on the files size makes sense, I will try it out and try to measure...

    By the way: looking at the code it seems that cppcheck always gives back either EXIT_SUCCESS or EXIT_FAILURE as return code, is that correct?

    And if it returns EXIT_FAILURE, does it always include exactly one statement "cppcheck: error: ... " in its output and always as the last statement?

    And my last question: is it okay, if I use your cppcheck logo in my project of a plugin?

    Great many thanks and regards

    frithjof

     
  • atulya

    atulya - 2014-09-04

    Hi CPPCheck Team,

    Greetings !!

    I have copied a cppcheck installed folder on a machine, where I don't have admin rights to install.
    While running cppcheck from command prompt I am getting below error
    msvcp120.dll is missing on my system.
    I have copied the above missing dll in platforms directory.
    But still, I am getting same above error.

    Any suggestions how I can resolve this problem?

    Regards
    Atulya

     
    • Bassam Abdul-Baki

      Atulya,

      The only file that needs to be in the platforms directory is qwindows.dll. All the other DLLs need to be in the root folder with the Cppcheck executable.

      Bassam

       
      • atulya

        atulya - 2014-09-04

        Thanks for Reply Bassam,

        Got it working after copying into cppcheck directory.

        Thanks and Regards
        Atulya

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks