JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc


Source Files

On occasion, you may want to see a source file in its entirety. The CodeSonar analysis caches copies of project source files for the most recent analysis of each project. The GUI Source Listing pages display source files with syntax coloring, hyperlinks, and highlighted endpoints.

Viewing a Source File

There are several ways to navigate to project source files. Since you are currently viewing a warning report, it will be most convenient to navigate from there.

  1. Do one of the following.
  2. If necessary, scroll up to the top of the page you have navigated to.

Source File Page

You should see a page that looks (something) like this:

Screenshot: Source Listing Page

Summary Information

  1. Click File Details at the top of the Source Listing to view additional information about the file.

    Screenshot: summary information on Source Listing page

    The Lines field can be expanded by clicking on its show details link.
  2. Click show details next to the Lines count to view more detailed line count figures.

    Screenshot: expanded Lines section

  3. The line directly under the page heading includes a link to a Warning Search Results page listing all warnings issued in the file.
    Click view all to view the list of warnings.
  4. Use your browser's Back button to return to the BasicProj.c file listing.

Source Code Navigation

There is extensive navigation functionality within the file listing. For a full description of the kinds of hyperlinks available in CodeSonar output, see section Source Coloring and Interaction.

Included Files

The names of included files are interactive.

  1. Find the #include directive at the top of the BasicProj.c file listing.
  2. Position the mouse over <stdlib.h>.

    This will open an information window displaying information about stdlib.h.

  3. Click <stdlib.h> and select the new tab icon next to Go to this file in the menu that opens.

    This will open the Source Listing for stdlib.h in a new tab. Usually we are more interested in source files created for a project than headers for standard libraries, so we won't look further at this listing.

  4. Close the new tab and return to the tab containing the BasicProj.c file listing.

Macros

Names of macros have special MACRONAME coloring. Macro names are interactive.

  1. Position the mouse over NULL on line 16 to view its cross-referencing information and definition in the information window.
  2. Click NULL and select Expand macro definition from the menu that opens.

    A box will expand inside the listing, showing the definition of macro NULL and giving the name of the file in which it can be found.

    Screenshot fragment: expanded NULL macro

    (The definition of NULL may be different on your machine, as may the name of the library file that defines it.)

  3. You can do any of the following with the newly expanded box, if you wish.
    • Click the file name to navigate to the file listing for stdlib.h.
    • Click the X link in the top-right corner to collapse the box.
    • Click the up triangle and down triangle links to show more lines from stdlib.h in the box.
    • Leave the box where it is and continue your examination of the source file.

Warning

Every warning location in the file is indicated with a warning annotation specifying how many warnings were issued at that location, and listing the classes and ID numbers of those warnings with links to the corresponding warning reports.

Screenshot: other warning annotation in a warning report

This is the end of the Basic Tutorial. If you like, you can go to the tutorial index and choose another tutorial exercise.

 

To report problems with this documentation, please visit https://support.codesecure.com/.