Re: kernel programming questions

Richard B. Johnson (root@analogic.com)
Mon, 30 Jun 1997 23:29:16 -0400 (EDT)


On Mon, 30 Jun 1997, Michael Bruck wrote:

> Ok, two short questions:
>
> Is there a arch-independant type available for the
> save_flags macro ? (flags_t ??)
>
> Is there a problem that could prevent one from using memory
> alloc'd from stack in the kernel like
>
> int foo(int bar)
> {
> int foo_bar[bar];
> ...
> }

Even though that works.... There SHOULD be a problem with it! Don't
write code like that. For some reason gcc lets you get away with it.
If you must write code like that it's broken from the start. Automatic
variables are supposed to be automatic, not dynamic.

Cheers,
DJ
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Analogic Corporation
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.44 on an i586 machine (66.15 BogoMips).
Warning : It's hard to stay on the trailing edge of technology.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-