Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #13672: Update manual before release #7339

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions man/manual-premium.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,16 @@ The available options are:

- c89: C code is C89 compatible
- c99: C code is C99 compatible
- c11: C code is C11 compatible (default)
- c11: C code is C11 compatible
- c17: C code is C17 compatible
- c23: C code is C23 compatible (default)
- c++03: C++ code is C++03 compatible
- c++11: C++ code is C++11 compatible
- c++14: C++ code is C++14 compatible
- c++17: C++ code is C++17 compatible
- c++20: C++ code is C++20 compatible (default)
- c++20: C++ code is C++20 compatible
- c++23: C++ code is C++23 compatible
- c++26: C++ code is C++26 compatible (default)

# Cppcheck build dir

Expand Down Expand Up @@ -755,14 +759,14 @@ The output will look like this:

## User defined output format (single line)

You can write your own pattern. For instance, to get warning messages that are formatted like traditional gcc, then the following format can be used:
You can write your own pattern. For instance, to get warning messages that are separated by colon you could use this pattern:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text is not strictly correct. There are spaces in the pattern also. I think this would be better then:

Suggested change
You can write your own pattern. For instance, to get warning messages that are separated by colon you could use this pattern:
You can write your own pattern. For instance:


cppcheck --template="{file}:{line}: {severity}: {message}" samples/arrayIndexOutOfBounds/bad.c
cppcheck --template="{file}:{line}:{column}: {severity}: {message}" samples/arrayIndexOutOfBounds/bad.c

The output will then look like this:

Checking samples/arrayIndexOutOfBounds/bad.c ...
samples/arrayIndexOutOfBounds/bad.c:6: error: Array 'a[2]' accessed at index 2, which is out of bounds.
samples/arrayIndexOutOfBounds/bad.c:6:6: error: Array 'a[2]' accessed at index 2, which is out of bounds.

A comma separated format:

Expand Down Expand Up @@ -1083,6 +1087,12 @@ Example usage:

# Check Level

## Reduced

The "reduced" check level performs a limited data flow analysis. If developers
want to run cppcheck directly during development and require faster results
than "normal" provides then this reduced checking can be an option.

## Normal

The "normal" check level is chosen by default. Our aim is that this checking level will provide an effective checking in "reasonable" time.
Expand Down Expand Up @@ -1163,10 +1173,18 @@ Command to active Cert C++ checkers:

cppcheck --premium=cert-c++ ....

Command to active Misra C 2023 checkers:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

active => activate

seems it's wrong in the other places also.


cppcheck --premium=misra-c-2023 ....

Command to active Misra C++ 2008 checkers:

cppcheck --premium=misra-c++-2008 ....

Command to active Misra C++ 2023 checkers:

cppcheck --premium=misra-c++-2023 ....

## Compliance report

### Graphical user interface
Expand Down
53 changes: 9 additions & 44 deletions man/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,16 @@ The available options are:

- c89: C code is C89 compatible
- c99: C code is C99 compatible
- c11: C code is C11 compatible (default)
- c11: C code is C11 compatible
- c17: C code is C17 compatible
- c23: C code is C23 compatible (default)
- c++03: C++ code is C++03 compatible
- c++11: C++ code is C++11 compatible
- c++14: C++ code is C++14 compatible
- c++17: C++ code is C++17 compatible
- c++20: C++ code is C++20 compatible (default)
- c++20: C++ code is C++20 compatible
- c++23: C++ code is C++23 compatible
- c++26: C++ code is C++26 compatible (default)

# Cppcheck build dir

Expand Down Expand Up @@ -756,14 +760,14 @@ The output will look like this:

## User defined output format (single line)

You can write your own pattern. For instance, to get warning messages that are formatted like traditional gcc, then the following format can be used:
You can write your own pattern. For instance, to get warning messages that are separated by colon you could use this pattern::

cppcheck --template="{file}:{line}: {severity}: {message}" samples/arrayIndexOutOfBounds/bad.c
cppcheck --template="{file}:{line}:{column}: {severity}: {message}" samples/arrayIndexOutOfBounds/bad.c

The output will then look like this:

Checking samples/arrayIndexOutOfBounds/bad.c ...
samples/arrayIndexOutOfBounds/bad.c:6: error: Array 'a[2]' accessed at index 2, which is out of bounds.
samples/arrayIndexOutOfBounds/bad.c:6:6: error: Array 'a[2]' accessed at index 2, which is out of bounds.

A comma separated format:

Expand Down Expand Up @@ -1137,45 +1141,6 @@ In the GUI:

If you want to use these limitations on the command line also you can import the GUI project file with --project.

# Cppcheck Premium

## Bug hunting

This is analysis that is more noisy than normal analysis. Most warnings will be false positives (cppcheck will wrongly claim that there are bugs). The design goal is to not have more than roughly 5 - 10 false positives in each file.

It is not intended to be used in normal CI or regular static analysis by developers. The noise makes it useless for that.

It is intended to be used when you are looking for bugs and you really can accept noise. For example:
* You have developed a brand new feature and want to ensure that there are no bugs.
* Maybe as part of release testing your product you can run bug hunting on modified files.
* Etc

Technically, analysis that is "sound" will detect all bugs. Analysis that is "soundy" has the goal to detect most bugs and it tries to keep the noise at an reasonable level.

The Cppcheck bug hunting analysis is "soundy".

Command:

cppcheck --premium=bughunting ....

## Coding standards

Command to active Autosar checkers:

cppcheck --premium=autosar ....

Command to active Cert C checkers:

cppcheck --premium=cert-c ....

Command to active Cert C++ checkers:

cppcheck --premium=cert-c++ ....

Command to active Misra C++ 2008 checkers:

cppcheck --premium=misra-c++-2008 ....

## Licenses
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ## Licenses should also be remove from the open source manual.


### Individual license
Expand Down
Loading