Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Pass include directories to cppcheck #17

Closed
GoogleCodeExporter opened this issue Jul 15, 2015 · 2 comments
Closed

Pass include directories to cppcheck #17

GoogleCodeExporter opened this issue Jul 15, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Sometimes it is necessary to pass additional include directories. I have
attached an example of why this is necessary and the different results are
found below.  Basically if cppcheck can't find a header file that includes
a typedef it does not include that variable for check as uninitialized (I'm
not sure what else it would miss).


Executing '"C:\Program Files\Cppcheck\cppcheck.exe" --xml "-j 1"
--enable=style,possibleError --force
C:\ide-4.6-workspace\cppcheck_example\src\main.c'
<?xml version="1.0"?>
Checking C:\ide-4.6-workspace\cppcheck_example\src\main.c...
<results>
<error file="C:\ide-4.6-workspace\cppcheck_example\src\main.c" line="8"
id="unassignedVariable" severity="style" msg="Variable 'uninit_i32' is not
assigned a value"/>
<error file="C:\ide-4.6-workspace\cppcheck_example\src\main.c" line="12"
id="uninitvar" severity="error" msg="Uninitialized variable: uninit_i32"/>
</results>
Duration 110 ms.

Compared with calling it from console with the includes directory passed as
argument.

C:\ide-4.6-workspace\cppcheck_example>"C:\Program
Files\Cppcheck\cppcheck.exe" --force --enable=style,possibleError -I
includes src/main.c
Checking src\main.c...
[src\main.c:8]: (style) Variable 'uninit_i32' is not assigned a value
[src\main.c:8]: (style) Variable 'uninit_i32_header' is not assigned a value
[src\main.c:12]: (error) Uninitialized variable: uninit_i32
[src\main.c:15]: (error) Uninitialized variable: uninit_i32_header

Original issue reported on code.google.com by konra...@gmx.de on 16 May 2010 at 11:31

Attachments:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant