Web lists-archives.com

Errors and other unpleasant things found by Cppcheck




Hi,

I analyzed the GitHub repository with Cppcheck. The resulting XML file is attached. Please open it in Cppcheck to view it comfortably.

Especially the bunch of errors could be of interest to you.

Greetings

Friedrich

<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
    <cppcheck version="1.81"/>
    <errors>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: git_dir" verbose="Uninitialized variable: git_dir">
            <location file="config.c" line="219"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: oe" verbose="Uninitialized variable: oe">
            <location file="fast-import.c" line="3006"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: oe" verbose="Uninitialized variable: oe">
            <location file="fast-import.c" line="3023"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: mrtree" verbose="Uninitialized variable: mrtree">
            <location file="merge-recursive.c" line="2064"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: saved_namelen" verbose="Uninitialized variable: saved_namelen">
            <location file="read-cache.c" line="2107"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: explicit" verbose="Uninitialized variable: explicit">
            <location file="ref-filter.c" line="1287"/>
        </error>
        <error id="unknownEvaluationOrder" severity="error" msg="Expression &amp;#039;prev_ch=p_ch,(p_ch=*++p)!=&amp;#039;]&amp;#039;&amp;#039; depends on order of evaluation of side effects" verbose="Expression &amp;#039;prev_ch=p_ch,(p_ch=*++p)!=&amp;#039;]&amp;#039;&amp;#039; depends on order of evaluation of side effects">
            <location file="wildmatch.c" line="263"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="268"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="692"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="758"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: string_list_item" verbose="Uninitialized variable: string_list_item">
            <location file="builtin\clean.c" line="357"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="688"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clean.c" line="1009"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\clone.c" line="1000"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\config.c" line="456"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\describe.c" line="161"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\describe.c" line="175"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: pos" verbose="Uninitialized variable: pos">
            <location file="builtin\interpret-trailers.c" line="46"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: tmp" verbose="Uninitialized variable: tmp">
            <location file="builtin\interpret-trailers.c" line="46"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\ls-files.c" line="259"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\name-rev.c" line="202"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\name-rev.c" line="213"/>
        </error>
        <error id="doubleFree" severity="error" msg="Memory pointed to by &amp;#039;buf&amp;#039; is freed twice." verbose="Memory pointed to by &amp;#039;buf&amp;#039; is freed twice.">
            <location file="builtin\notes.c" line="265"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: item" verbose="Uninitialized variable: item">
            <location file="builtin\repack.c" line="314"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: reaches" verbose="Uninitialized variable: reaches">
            <location file="builtin\rev-list.c" line="482"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: all" verbose="Uninitialized variable: all">
            <location file="builtin\rev-list.c" line="482"/>
        </error>
        <error id="leakNoVarFunctionCall" severity="error" msg="Allocation with malloc_startup, memcpy doesn&amp;#039;t release it." verbose="Allocation with malloc_startup, memcpy doesn&amp;#039;t release it.">
            <location file="compat\mingw.c" line="2139"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: sbcset" verbose="Memory leak: sbcset">
            <location file="compat\regex\regcomp.c" line="3085"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: mbcset" verbose="Memory leak: mbcset">
            <location file="compat\regex\regcomp.c" line="3085"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: sbcset" verbose="Memory leak: sbcset">
            <location file="compat\regex\regcomp.c" line="3633"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: mbcset" verbose="Memory leak: mbcset">
            <location file="compat\regex\regcomp.c" line="3633"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: table_size" verbose="Uninitialized variable: table_size">
            <location file="compat\regex\regcomp.c" line="2801"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: table_size" verbose="Uninitialized variable: table_size">
            <location file="compat\regex\regcomp.c" line="2804"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: lrr_count" verbose="Uninitialized variable: lrr_count">
            <location file="contrib\examples\builtin-fetch--tool.c" line="420"/>
        </error>
        <error id="uninitvar" severity="error" msg="Uninitialized variable: lrr_list" verbose="Uninitialized variable: lrr_list">
            <location file="contrib\examples\builtin-fetch--tool.c" line="427"/>
        </error>
        <error id="preprocessorErrorDirective" severity="error" msg="No header in #include" verbose="No header in #include">
            <location file="sha1dc\ubc_check.c" line="31"/>
        </error>
        <error id="preprocessorErrorDirective" severity="error" msg="No header in #include" verbose="No header in #include">
            <location file="sha1dc\ubc_check.c" line="371"/>
        </error>
        <error id="preprocessorErrorDirective" severity="error" msg="No header in #include" verbose="No header in #include">
            <location file="sha1dc\ubc_check.h" line="49"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: entries" verbose="Memory leak: entries">
            <location file="t\helper\test-hashmap.c" line="129"/>
        </error>
        <error id="memleak" severity="error" msg="Memory leak: hashes" verbose="Memory leak: hashes">
            <location file="t\helper\test-hashmap.c" line="129"/>
        </error>
        <error id="syntaxError" severity="error" msg="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined." verbose="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined.">
            <location file="t\t4051\appended1.c" line="3"/>
        </error>
        <error id="syntaxError" severity="error" msg="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined." verbose="Invalid number of character &amp;#039;{&amp;#039; when no macros are defined.">
            <location file="t\t4051\appended2.c" line="35"/>
        </error>
    </errors>
</results>