diff --git a/man/reference-cfg-format.md b/man/reference-cfg-format.md index 0c631b435..02246fe80 100644 --- a/man/reference-cfg-format.md +++ b/man/reference-cfg-format.md @@ -156,24 +156,39 @@ If you provide a configuration file then Cppcheck detects the bug: Checking uninit.c... [uninit.c:5]: (error) Uninitialized variable: buffer2 -Note that this implies for pointers that the memory they point at has to be initialized, too. +Below windows.cfg is shown: -Here is the minimal windows.cfg: +Version 1: + -The `indirect` attribute can be set to control the indirection of uninitialized memory allowed. Setting `indirect` to `0` means no uninitialized memory is allowed. Setting it to `1` allows a pointer to uninitialized memory. Setting it to `2` allows a pointer to pointer to uninitialized memory. +Version 2: -By default, cppcheck will use an indirect value of `0` unless `not-null` is used. When `not-null` is used, then `indirect` will default to `1`. + + + + + + + + + + + + +Version 1: If `indirect` attribute is not used then the level of indirection is determined automatically. The `` tells Cppcheck that the pointer must be initialized. The `` tells Cppcheck to check 1 extra level. This configuration means that both the pointer and the data must be initialized. + +Version 2: The `indirect` attribute can be set to explicitly control the level of indirection used in checking. Setting `indirect` to `0` means no uninitialized memory is allowed. Setting it to `1` allows a pointer to uninitialized memory. Setting it to `2` allows a pointer to pointer to uninitialized memory. ### Null pointers