From: Mikael Pettersson <mikpe@csd.uu.se>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: Dave Olien <dmo@osdl.org>,
Petri Koistinen <petri.koistinen@iki.fi>,
linux-kernel@vger.kernel.org
Subject: Re: Sparse warning: bitmap.h: bad constant expression
Date: Tue, 2 Sep 2003 12:23:44 +0200 [thread overview]
Message-ID: <16212.28592.322946.64754@gargle.gargle.HOWL> (raw)
In-Reply-To: <20030902095628.GB7616@wohnheim.fh-wedel.de>
=?iso-8859-1?Q?J=F6rn?= Engel writes:
> On Mon, 1 September 2003 18:57:02 -0700, Dave Olien wrote:
> >
> > The problem seems to be that sparse currently will only accept array
> > declarations with a size that can be evaluated at compile time to
> > a fixed value. So an array declaration of the form:
> >
> > int asize;
> > int data[asize];
> >
> > will fail. sparse needs to be modified to recognize this type of
> > declaration with a variable array size. That'll take a few hours of
> > someone's time to fix.
>
> Not quite true. The above is an implicit call to alloca and should
> not exist in the kernel. No need to hack support into sparse.
If data is a local variable then this is perfectly valid example of a
C99 variable-length array (VLA). This works at least with gcc-2.95.3
and newer, and gcc handles it by itself w/o calling alloca().
Of course, VLAs should be bounded in size to avoid overflowing the
kernel stack, but that doesn't make them illegal per se.
/Mikael
next prev parent reply other threads:[~2003-09-02 10:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-01 19:59 Petri Koistinen
2003-09-02 1:57 ` Dave Olien
2003-09-02 9:56 ` Jörn Engel
2003-09-02 10:23 ` Mikael Pettersson [this message]
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
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=16212.28592.322946.64754@gargle.gargle.HOWL \
--to=mikpe@csd.uu.se \
--cc=dmo@osdl.org \
--cc=joern@wohnheim.fh-wedel.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®