[lkml]   [2003]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PREFIX is non-empty
In message <> you wri
> 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.

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

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.

Speed is certainly of absolutely no importance here.

Changing it to do a kmalloc every time around the loop is complex,
inefficient, unneccessary, and introduces another failure path.

In summary, I can't see any reason why the clearest, simplest code
should be avoided.

Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:32    [W:0.035 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site