All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Petri Koistinen <petri.koistinen@iki.fi>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Sparse warning: bitmap.h: bad constant expression
Date: Tue, 2 Sep 2003 10:22:48 -0700	[thread overview]
Message-ID: <20030902172248.GL4306@holomorphy.com> (raw)
In-Reply-To: <Pine.LNX.4.56.0309012249230.14789@dsl-hkigw4a35.dial.inet.fi>

On Mon, Sep 01, 2003 at 10:59:21PM +0300, Petri Koistinen wrote:
> If I try to compile latest kernel with "make C=1" I'll get many warning
> messages from sparse saying:
> warning: include/linux/bitmap.h:85:2: bad constant expression
> warning: include/linux/bitmap.h:98:2: bad constant expression
> Sparse doesn't seem to like DECLARE_BITMAP macros.
> #define DECLARE_BITMAP(name,bits) \
>         unsigned long name[BITS_TO_LONGS(bits)]
> So what is wrong with this and how it could be fixed so that sparse
> wouldn't complain?

Basically, this thing is intended to be used with a constant bits
argument that's constant folded etc. at all times, but sparse doesn't
know that.

One way to deal with it is to turn the thing into a giant macro.


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
On Mon, Sep 01, 2003 at 10:59:21PM +0300, Petri Koistinen wrote:
> If I try to compile latest kernel with "make C=1" I'll get many warning
> messages from sparse saying:
> warning: include/linux/bitmap.h:85:2: bad constant expression
> warning: include/linux/bitmap.h:98:2: bad constant expression
> Sparse doesn't seem to like DECLARE_BITMAP macros.
> #define DECLARE_BITMAP(name,bits) \
>         unsigned long name[BITS_TO_LONGS(bits)]
> So what is wrong with this and how it could be fixed so that sparse
> wouldn't complain?

Basically, this thing is intended to be used with a constant bits
argument that's constant folded etc. at all times, but sparse doesn't
know that.

One way to deal with it is to turn the thing into a giant macro.


-- wli

      parent reply	other threads:[~2003-09-02 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-01 19:59 Sparse warning: bitmap.h: bad constant expression Petri Koistinen
2003-09-02  1:57 ` Dave Olien
2003-09-02  9:56   ` Jörn Engel
2003-09-02 10:23     ` Mikael Pettersson
2003-09-02 10:54       ` Jörn Engel
2003-09-02 16:45       ` Linus Torvalds
2003-09-02 20:08       ` Jörn Engel
2003-09-02 17:38     ` Dave Olien
2003-09-02 20:11       ` Jörn Engel
2003-09-02 17:22 ` William Lee Irwin III [this message]

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=20030902172248.GL4306@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petri.koistinen@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.