public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kaih@khms.westfalen.de (Kai Henningsen)
To: rusty@rustcorp.com.au
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PRE
Date: 13 Jan 2003 20:56:00 +0200	[thread overview]
Message-ID: <8do$n39mw-B@khms.westfalen.de> (raw)
In-Reply-To: <20030111224007$7807@gated-at.bofh.it>

rusty@rustcorp.com.au (Rusty Russell)  wrote on 11.01.03 in <20030111224007$7807@gated-at.bofh.it>:

> In message <Pine.LNX.4.44.0301102134150.9532-100000@home.transmeta.com> you
> wri te:
> >
> > On Sat, 11 Jan 2003, Rusty Russell wrote:
> > >
> > > Just in case someone names a variable over 2000 chars, and uses it as
> > > an old-style module parameter?
> >
> > No. Just because variable-sized arrays aren't C, and generate crappy code.
> >
> > >  	for (i = 0; i < num; i++) {
> > > +		char sym_name[strlen(obsparm[i].name)
> > > +			     + sizeof(MODULE_SYMBOL_PREFIX)];
> >
> > It's still there.
>
> OK, *please* explain to me in little words so I can understand.

Do "char sym_name[CONSTANT];". What's so hard to understand about that?

> Variable-sized arrays are C, as of C99.  They've been a GNU extension
> forever.

Actually, the gcc thing and the C99 thing are significantly different, and  
neither is a sub- or superset of the other. In fact, gcc's C99-conformance  
page (http://gcc.gnu.org/c99status.html) still lists VLAs as "broken".

See here for at least some explanation:
        http://gcc.gnu.org/ml/gcc/2002-10/msg00470.html

> While gcc 2.95.4 generates fairly horrible code, gcc 3.0 does better
> (the two compilers I have on my laptop).
>
> Both generate correct code.

For the GNU extension, maybe.

MfG Kai

       reply	other threads:[~2003-01-13 19:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030111224007$7807@gated-at.bofh.it>
2003-01-13 18:56 ` Kai Henningsen [this message]
2003-01-13 20:28   ` [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PRE Richard B. Johnson
2003-01-13 20:43     ` Valdis.Kletnieks
2003-01-13 21:01       ` Richard B. Johnson

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='8do$n39mw-B@khms.westfalen.de' \
    --to=kaih@khms.westfalen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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