From: Marek Otahal <markotahal@gmail.com>
To: util-linux@vger.kernel.org
Subject: dev.c : Warning - dereference of null pointer, clang --analyze
Date: Tue, 19 Jun 2012 13:44:12 +0200 [thread overview]
Message-ID: <1468557.if6BRfJlxj@beruska> (raw)
Hi list,
I was just building util-linux with clang to see how it's static code analysis works.
Here's what I got so far, I'm not sure about it's correctness, so excuse me if it's stupid.
CC dev.lo
clang: warning: unknown warning option '-Wmissing-parameter-type'; did you mean '-Wmissing-prototypes'?
clang: warning: unknown warning option '-Wunused-but-set-parameter'; did you mean '-Wunused-parameter'?
clang: warning: unknown warning option '-Wunused-but-set-variable'; did you mean '-Wunused-variable'?
dev.c:91:16: warning: Access to field 'next' results in a dereference of a null pointer
(loaded from variable 'p')
list_for_each(p, &dev->bid_tags) {
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
../../include/list.h:179:48: note: expanded from macro 'list_for_each'
for (pos = (head)->next; pos != (head); pos = pos->next)
^
1 warning generated.
Best regards, Mark
--
Marek Otahal :o)
next reply other threads:[~2012-06-19 11:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-19 11:44 Marek Otahal [this message]
2012-06-19 12:46 ` Clang analysis warnings WAS: Re: dev.c : Warning - dereference of null pointer, clang --analyze Marek Otahal
2012-06-19 13:04 ` [cont.] " Marek Otahal
2012-06-19 13:49 ` [cont.2] " Marek Otahal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468557.if6BRfJlxj@beruska \
--to=markotahal@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).