kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: bernd@petrovitsch.priv.at (Bernd Petrovitsch)
To: kernelnewbies@lists.kernelnewbies.org
Subject: variant length array?
Date: Wed, 06 Apr 2016 12:51:16 +0200	[thread overview]
Message-ID: <1459939885.3137.37.camel@thorin> (raw)
In-Reply-To: <CAEnvTt1kKisXGSvGYA9GQ_Qn28eDmhS8KunsSOudLhHtX-ZWjA@mail.gmail.com>

Hi!

On Die, 2016-04-05 at 15:29 -0400, Wenda Ni wrote:
[...]
> I come across the following code in a kernel module code. It defines an
> array whose length is variant at runtime, depending on the actual inputs.
> It seems that kernel compiler supports this, which is obvious an error in
> the standard ANSI C. Do I have the correct understanding on it?

ANSI-C ist old and enforced with -std=c89 with gcc (see manual page).
VLAs are allowed since (standard) C99.

	Bernd
-- 
"What happens when you read some doc and either it doesn't answer your
question or is demonstrably wrong? In Linux, you say "Linux sucks" and
go read the code. In Windows/Oracle/etc you say "Windows sucks" and
start banging your head against the wall."    - Denis Vlasenko on lkml

      parent reply	other threads:[~2016-04-06 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 19:29 variant length array? Wenda Ni
2016-04-05 19:43 ` Robert P. J. Day
2016-04-05 20:00   ` Bjørn Mork
2016-04-05 20:23     ` Rajat Sharma
2016-04-05 21:16     ` Robert P. J. Day
2016-04-05 20:19 ` Valdis.Kletnieks at vt.edu
2016-04-05 20:29   ` Wenda Ni
2016-04-06 10:51 ` Bernd Petrovitsch [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=1459939885.3137.37.camel@thorin \
    --to=bernd@petrovitsch.priv.at \
    --cc=kernelnewbies@lists.kernelnewbies.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).