[U-Boot] use of C99

Wolfgang Denk
2009-04-08T19:28:32Z

Dear Kumar Gala,

In message <4A0B9AAA-4714-4C27-84A7-22FCE4D91DDA@freescale.com> you wrote:
> I was wondering if there was any reason we avoid C99 features in u-
> boot source.
>
> Specifically the ability to declare variables in the middle of
> functions.

One reason is that I consider such code extremely ugly and hard to
read and understand.

> There are a slew of places that we have something like:
...
> #ifdef CONFIG_COOL_FEATURE
> u32 myvarrocks = foo * bar * bar;
>
> gd->neato = myvarrocks
> #endif

It would be even better to avoid such #ifdef's, or at least the need
for such special local variables.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Life is a process, not a principle, a mystery to be lived, not a
problem to be solved. - Gerard Straub, television producer and author
(stolen from Frank Herbert??)