Skip to contentSkip to conversation

help for using sparse

DISCUSSION bonneta 5 participants 7 messages Jun 9, 2010 Sparse checker

lore
Share & tools
lore

bonneta

author
#0 lore raw

Hello,

I am working on git, and i would like to apply sparse on its source code.

I've downloaded the source of sparse from its git repository, and compiled it successfully.

I've read the little documentation furnished with the code, but i didn't manage to apply sparse on the sources of git.

I've basically tried "sparse file.c", but it always returns with an error like :
"git-compat-util.h:140:11: error: unable to open 'openssl/ssl.h'" or
"builtin/blame.c:7:10: error: unable to open 'cache.h'"

I don't know how to resolve it...

Axel

maintainer
#1 lore raw
Quoted 7 lines · bonneta

I've basically tried "sparse file.c", but it always returns with an error like :
"git-compat-util.h:140:11: error: unable to open 'openssl/ssl.h'" or
"builtin/blame.c:7:10: error: unable to open 'cache.h'"

I don't know how to resolve it...

You need to tell sparse where is your openssl/ssl.h.

BTW, can you compile file.c using git's make system? You can try to copy the file searching path to sparse.

Another thing to try is using the cgcc. Cgcc is a wrapper script that try to behave like gcc + sparse check.

Chris

#2 lore raw
In reply to bonneta
Quoted 6 lines · bonneta

I've basically tried "sparse file.c", but it always returns with an error like :
"git-compat-util.h:140:11: error: unable to open 'openssl/ssl.h'" or
"builtin/blame.c:7:10: error: unable to open 'cache.h'"

make CC=~/path/to/sparse/cgcc

regards,
dan carpenter

#3 lore raw
In reply to bonneta
Quoted 8 lines · bonneta

I am working on git, and i would like to apply sparse on its source code.

I've downloaded the source of sparse from its git repository, and compiled it successfully.

I've read the little documentation furnished with the code, but i didn't manage to apply sparse on the sources of git.

Quoted 7 lines

I've basically tried "sparse file.c", but it always returns with an error like :
"git-compat-util.h:140:11: error: unable to open 'openssl/ssl.h'" or
"builtin/blame.c:7:10: error: unable to open 'cache.h'"

I don't know how to resolve it...

These errors occur because you haven't supplied the full compiler command-line that Git supplies in its build process, which includes flags for include paths.

The script "cgcc", provided with sparse, provides the most convenient way to integrate Sparse into an existing build system with minimal work. Once you've done a "make install" of Sparse into a directory on your $PATH (or just put the Sparse source directory on your $PATH), just do "make CC=cgcc".

- Josh Triplett

author
#4 lore raw
Quoted 2 lines · Josh Triplett
Quoted 1 line · bonneta

I am working on git, and i would like to apply sparse on its source

code.

Quoted 6 lines
Quoted 6 lines

I've downloaded the source of sparse from its git repository, and compiled
it successfully.

I've read the little documentation furnished with the code, but i

didn't

Quoted 3 lines
Quoted 3 lines

manage to apply sparse on the sources of git.

I've basically tried "sparse file.c", but it always returns with an

error

Quoted 11 lines
Quoted 6 lines

like :
"git-compat-util.h:140:11: error: unable to open 'openssl/ssl.h'" or
"builtin/blame.c:7:10: error: unable to open 'cache.h'"

I don't know how to resolve it...

These errors occur because you haven't supplied the full compiler command-line that Git supplies in its build process, which includes flags for include paths.

Quoted 5 lines

The script "cgcc", provided with sparse, provides the most convenient way to integrate Sparse into an existing build system with minimal work. Once you've done a "make install" of Sparse into a directory on your $PATH (or just put the Sparse source directory on your $PATH), just do "make CC=cgcc".

Thank you all, it works fine.
Does sparse look for all the errors with this method?

I saw in the sparse man page that a "Wsparse-all" option exists. Is it used by default? Otherwise how to use it in the "make" command line?

Axel Bonnet

Quoted 4 lines

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse"

in

Quoted 2 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 2 lines · bonneta

Thank you all, it works fine.
Does sparse look for all the errors with this method?

Don't know the defaults.

Quoted 4 lines

I saw in the sparse man page that a "Wsparse-all" option exists. Is it used by default? Otherwise how to use it in the "make" command line?

CHECK="~/path/to/sparse --params" make CC=~/path/to/cgcc

regards,
dan carpenter

#6 lore raw
In reply to bonneta
Quoted 9 lines · bonneta

Hello,

I am working on git, and i would like to apply sparse on its source code.

I've downloaded the source of sparse from its git repository, and compiled it successfully.

I've read the little documentation furnished with the code, but i didn't manage to apply sparse on the sources of git.

It looks like git already supports sparse.

Try "make check"

Try to search for "sparse" in the makefile of git.

Sam