|
|
Subscribe / Log in / New account

Smatch: pluggable static analysis for C

Smatch: pluggable static analysis for C

Posted Jun 29, 2016 18:31 UTC (Wed) by moorray (guest, #54145)
Parent article: Smatch: pluggable static analysis for C

Smatch is a bit hard to use. I recently spent few hours trying to generate symbol database and then to test out-of-the-tree repo but failed and gave up :( I was wondering if the last paragraph indicates that the author was able to use sparse on a smaller and possibly out-of-tree body of code?


to post comments

Smatch: pluggable static analysis for C

Posted Jun 30, 2016 4:57 UTC (Thu) by neilbrown (subscriber, #359) [Link]

> I was wondering if the last paragraph indicates that the author was able to use sparse on a smaller and possibly out-of-tree body of code?

It certainly does. I placed the line

smatch -I/usr/include/x86_64-linux-gnu/ $(CPPFLAGS) $<

in the appropriate place in my Makefile and it runs smatch and occasionally tells me that I assumed something might be NULL and then dereferenced that value, or that I'm calling malloc() with the wrong size.

I didn't try generating a symbol database. It still performs a number of tests without it.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds