Menu

--dump not creating a file. User error or something else?

7 days ago
6 days ago
  • centralcoast167

    centralcoast167 - 7 days ago

    ~~~ Hello,
    I am a new user and --dump is not creating a dump file as I would expect. I am using Cppcheck 2.18.0 on Windows 11 Pro 24H2.

    I am running the command "cppcheck --dump .\D_04_01.c".

    I get console output:
    Checking D_04_01.c ...
    Checking D_04_01.c: STDC_VERSION...

    I would expect a D_04_01.c.dump file to be created.


    If I run "cppcheck -f --enable=all --inconclusive --xml-version=2 -v --dump .\D_04_01.c"

    I get console output:

    <results version="2">
    <cppcheck version="2.18.0">
    <errors>
    Checking D_04_01.c ...
    Defines:
    Undefines:
    Includes:
    Platform:native
    <error id="missingIncludeSystem" severity="information" msg="Include file: &lt;stddef.h&gt; not found. Please note: Cppcheck does not need standard library headers to get proper results." verbose="Include file: &lt;stddef.h&gt; not found. Please note: Cppcheck does not need standard library headers to get proper results.">
    <location file="mc3_types.h" line="17" column="0">
    </location></error>
    <error id="missingIncludeSystem" severity="information" msg="Include file: &lt;stdint.h&gt; not found. Please note: Cppcheck does not need standard library headers to get proper results." verbose="Include file: &lt;stdint.h&gt; not found. Please note: Cppcheck does not need standard library headers to get proper results.">
    <location file="mc3_types.h" line="21" column="0">
    </location></error>
    <error id="missingIncludeSystem" severity="information" msg="Include file: &lt;stdbool.h&gt; not found. Please note: Cppcheck does not need standard library headers to get proper results." verbose="Include file: &lt;stdbool.h&gt; not found. Please note: Cppcheck does not need standard library headers to get proper results.">
    <location file="mc3_types.h" line="22" column="0">
    </location></error>
    <error id="knownConditionTrueFalse" severity="style" msg="Condition 'f3&gt;=0.0f' is always true" verbose="Condition 'f3&gt;=0.0f' is always true" cwe="571" file0="D_04_01.c">
    <location file="D_04_01.c" line="51" column="15" info="Condition 'f3&gt;=0.0f' is always true">
    <location file="D_04_01.c" line="45" column="21" info="Assignment 'f3=0.1f', assigned value is 0.1">
    </location></location></error>
    <error id="knownConditionTrueFalse" severity="style" msg="Condition 'f3&lt;=1.0f' is always true" verbose="Condition 'f3&lt;=1.0f' is always true" cwe="571" file0="D_04_01.c">
    <location file="D_04_01.c" line="51" column="33" info="Condition 'f3&lt;=1.0f' is always true">
    <location file="D_04_01.c" line="45" column="21" info="Assignment 'f3=0.1f', assigned value is 0.1">
    </location></location></error>
    <error id="constVariable" severity="style" msg="Variable 'msg_buffer' can be declared as const array" verbose="Variable 'msg_buffer' can be declared as const array" cwe="398" file0="D_04_01.c">
    <location file="D_04_01.c" line="64" column="16" info="Variable 'msg_buffer' can be declared as const array">
    <symbol>msg_buffer</symbol>
    </location></error>
    Checking D_04_01.c: STDC_VERSION...
    <error id="checkersReport" severity="information" msg="Active checkers: 117/966 (use --checkers-report=&lt;filename&gt; to see details)" verbose="Active checkers: 117/966 (use --checkers-report=&lt;filename&gt; to see details)">
    </error></errors>
    </cppcheck></results>

    But, no dump file. I have checked permissions. Any ideas? I would like to use the addon misra.py, so this is the first step to running it like:

    cppcheck --dump file.c
    python misra.py file.c.dump


    I have tried "cppcheck --enable=all --addon=..\AA_cppcheck\misra.json .\D_04_01.c"

    I get console output:

    Checking D_04_01.c ...
    mc3_types.h:17:0: information: Include file: <stddef.h> not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem]</stddef.h>

    include <stddef.h> / brings in NULL, size_t, ptrdiff_t, wchar_t /</stddef.h>

    ^
    mc3_types.h:21:0: information: Include file: <stdint.h> not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem]</stdint.h>

    include <stdint.h></stdint.h>

    ^
    mc3_types.h:22:0: information: Include file: <stdbool.h> not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem]</stdbool.h>

    include <stdbool.h></stdbool.h>

    ^
    D_04_01.c:51:15: style: Condition 'f3>=0.0f' is always true [knownConditionTrueFalse]
    if ( ( f3 >= 0.0f ) && ( f3 <= 1.0f ) )
    ^
    D_04_01.c:45:21: note: Assignment 'f3=0.1f', assigned value is 0.1
    float32_t f3 = 0.1f;
    ^
    D_04_01.c:51:15: note: Condition 'f3>=0.0f' is always true
    if ( ( f3 >= 0.0f ) && ( f3 <= 1.0f ) )
    ^
    D_04_01.c:51:33: style: Condition 'f3<=1.0f' is always true [knownConditionTrueFalse]
    if ( ( f3 >= 0.0f ) && ( f3 <= 1.0f ) )
    ^
    D_04_01.c:45:21: note: Assignment 'f3=0.1f', assigned value is 0.1
    float32_t f3 = 0.1f;
    ^
    D_04_01.c:51:33: note: Condition 'f3<=1.0f' is always true
    if ( ( f3 >= 0.0f ) && ( f3 <= 1.0f ) )
    ^
    D_04_01.c:64:16: style: Variable 'msg_buffer' can be declared as const array [constVariable]
    char msg_buffer [ MAX_MSG_SIZE ] = "message";
    ^
    Checking D_04_01.c: STDC_VERSION...
    **D_04_01.c:0:0: error: Bailing out from analysis: Checking file failed: Failed to execute addon 'misra' - exitcode is 1 [internalError]

    ^
    :0:0: error: Bailing out from analysis: Whole program analysis failed: Failed to execute addon 'misra' - exitcode is 1 [internalError]

    ^
    nofile:0:0: information: Active checkers: There was critical errors (use --checkers-report=<filename> to see details) [checkersReport]~~~**</filename>

    See the Bailing Out errors above :(

     

    Last edit: centralcoast167 6 days ago
  • centralcoast167

    centralcoast167 - 6 days ago

    Update: Works on my Linux machine, not on Windows 11

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.