From: Bob Copeland <me@bobcopeland.com>
To: linux-sparse@vger.kernel.org
Subject: error: ctype on uninitialized symbol
Date: Mon, 1 Feb 2016 14:44:09 -0500 [thread overview]
Message-ID: <20160201194409.GA15047@localhost> (raw)
Hi all,
I'm seeing the following error when running sparse with latest HEAD,
against the small test case at the end:
$ sparse sparse-test.c
[garbage]:0:0: error: ctype on uninitialized symbol 0x696ec0
I am getting this with calls to time_after(..., msecs_to_jiffies()) in my
kernel build.
Below, the "1UL + 1L" is a stand-in for MAX_JIFFY_OFFSET, and the value
has to be some operation on two different types to trigger for me (e.g.
1UL + 1UL will run without error). Taking out the typecheck macro will
also remove the error.
Any thoughts?
$ sparse --version
v0.5.0-44-g40791b9
sparse-test.c:
#define typecheck(type,x) \
({ type __dummy; \
typeof(x) __dummy2; \
(void)(&__dummy == &__dummy2); \
1; \
})
#define time_after(a,b) \
(typecheck(unsigned long, a) && \
typecheck(unsigned long, b) && \
((long)((b) - (a)) < 0))
static inline unsigned long y(void)
{
return 1UL+1L;
}
static void x(void)
{
int c = time_after(1UL, y());
}
--
Bob Copeland %% http://bobcopeland.com/
next reply other threads:[~2016-02-01 19:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 19:44 Bob Copeland [this message]
2016-02-02 2:53 ` error: ctype on uninitialized symbol Bob Copeland
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=20160201194409.GA15047@localhost \
--to=me@bobcopeland.com \
--cc=linux-sparse@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).