Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Error during parsing file (C++ static analysis)

epok
epok Posts: 3

Hello, this is my scenario:

  • Windows 7 platform
  • Parasoft C/C++ 9.6 Eclipse IDE
  • g++ inside Cygwin installation
  • Static analysis on C++ code (this code is compiled and executed on Linux platform)

After run a CRules static analysis I got the following errors: size_t undefined, nullptr undefined, __int28 undefined and so on pointing to include files of Cygwin.

Can you help me?
Thanks.

Comments

  • epok
    epok Posts: 3

    Update: if i try to compile the source file in the windows prompt, it performs successfully the compilation. It seems that Parasoft does not load properly some kind of configuration of g++.

  • epok
    epok Posts: 3

    Parasoft C/C++ 9.6 Eclipse IDE
    g++ 7.4.0 inside Cygwin installation

    Maybe g++ version is not compatible with Parasoft C/C++ 9.6 since latter supports g++ version until 5.x on 64-bit platform.

  • Hi @epok,

    If you are using compiler version 7.4, then definitely upgrade to newer version of C/C++test is needed. C++etst 9.6 is from around 2015 so it well pre-dates GNU GCC 7. We have just released 10.4.3 version a few weeks ago, and it supports GNU GCC up to and including 9.x.

    Also, it is important to properly configure which compiler family is set for your C/C++test project. This is done in Project properties> Parasoft> C++test> Build Settings> Compiler. You need to select the correct compiler version (7.x in your case), but also note that there are separate compiler configurations for 32- and 64-bit compilers, so make sure to select the correct one - either "GNU GCC 7.x" or "GNU GCC 7.x (x86-64)".

    Anyway, given your environment, the first thing to do is again to upgrade C/C++test to the latest one.

  • Abhishek
    Abhishek Posts: 2

    Hi Team,
    I am facing issue while using Parasoft C/C++ test suite. While importing IAR Embedded Workbench projects, the project does not get loaded.

    Steps followed:
    1. Choose File> New> Project and select Import IAR Embedded Workbench projects.
    2. Click Next and type (or browse to) the path to appropriate project/workspace file or directory.
    3. Click the Refresh button and select projects to import.
    4. Click Next and set the import destination, project contents and build configuration to use.
    5. Click Finish.
    Issue Found after Step 3 itself with no project getting loaded(I have loaded my project .ewp file in this step).

    Kindly assist/help if someone might have faced this issue in Parasoft C/C++test Professional, Version: 10.4.3.20191114B689

  • Bogdan Czwartkowski
    Bogdan Czwartkowski Posts: 157 admin
    edited March 2020

    Hello @Abhishek,
    Can you share which IAR EW are you using - version and target platform?

    You can find this information in IAR EW IDE> Help menu> Product info dialog.

  • Abhishek
    Abhishek Posts: 2

    Hi @Bogdan Czwartkowski,
    Thanks for your reply!!
    Yes,I am using IAR version 8.40.2 and Target platform is STM32.

  • Bogdan Czwartkowski
    Bogdan Czwartkowski Posts: 157 admin
    edited March 2020

    Hi @Abhishek
    Your rarget is STM32, so I understand you are using IAR EWARM, and you have IAR EWARM version which we support:
    https://docs.parasoft.com/display/CPPDESKE1043/IAR#IAR-IARCompilerforARMv.8.40x

    We provide option to import IAR EWARM projects for older versions of the IDE (5.3-6.3). For the current IAR EWARM 8.x you will need to:
    1. trace your build done with IarBuild.exe with our cpptesttrace utility,
    2. obtain Build Data File (BDF) from the trace process, and
    3. create in C/C++test Professional a project based on the BDF.
    This is further detailed here:
    https://docs.parasoft.com/display/CPPDESKE1043/About+EWARM

    Here are the steps that illustrate the process:

    1. Assume, your IAR EWARM project "Sensor" is located at:
      C:\Projects\Embedded\IAR-EWARM\Sensor\

    2. Your normal console build command with IAR build utility IarBuild.exe would be something like:
      "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\IarBuild.exe" Sensor.ewp -build Debug -log all

    3. You can trace the build command above with C/C++test's cpptesttrace utility as follows:
      C:\Progra~1\Parasoft\C++test\10.4\cpptesttrace.exe --cpptesttraceProjectName=Sensor --cpptesttraceResponseFileOption=-f --cpptesttraceOutputFile=C:\Projects\Embedded\IAR-EWARM\Sensor\cpptest.bdf "c:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\IarBuild.exe" Sensor.ewp -build Debug -log all

    4. The above command should produce build data file (cpptest.bdf) in the project folder. You can now launch the C/C++test Professional and create a project by importing the BDF file. Just go to File menu> New> Project..., and in the "New Project" dialog that opens select C/C++test> Create project from build data file.

    5. Follow the wizard to select your BDF location, select the correct compiler family and compiler .exe locations if not detected automatically, and continue to have C/C++test project created. From now on you should be able to run static analysis on the IAR EWARM project from within C/C++test.

    Notes:

    • IarBuild.exe does not allow for building entire workspace at once, so if you have multi-project workspace, you need to trace IarBuild.exe processes for each project separately.
    • The BDF does not need to be regenerated before each analysis run. You can generate it once, create C/C++test project based on it, and then only recreated BDF when your project structure changes (files added, renamed, moved), or when your compiler options change.