[BusyBox] Re: ifconfig: Clean up. [PATCH]
Shaun Jackman
sjackman at gmail.com
Mon Jul 25 17:36:35 UTC 2005
On 7/25/05, Rob Landley <rob at landley.net> wrote:
> Uh-huh. Are you volunteering to rewrite make menuconfig, maintain your own
> version separate from the linux version we periodically resync with, and
> explain to anybody out there who has tools that synthesize linux-format
> config files that our stuff has stopped behaving like the linux kernel's
> config system?
My suggestion doesn't require that menuconfig change one bit.
menuconfig already either writes...
#define CONFIG_FEATURE_CLEAN_UP 1
or
#undef CONFIG_FEATURE_CLEAN_UP
I suggested writing...
#ifndef CONFIG_FEATURE_CLEAN_UP
static const CONFIG_FEATURE_CLEAN_UP = 0;
#endif
This snippet can be maintained by hand in any header file. It then
allows CONFIG_FEATURE_CLEAN_UP to be used as an argument in either an
if() statement or an #ifdef.
> I was actually thinking of a static const int.
Whether it's a macro or a static const int, the identifier is best
spelt whichever way gives the reader the most information.
> > ... I'd start looking for the definition of do_cleanup and where it
> > was last modified.
>
> And since it's a global, you'd look in the header files. Are you implying you
> wouldn't find it?
I would find it, eventually. I'm suggesting that I would have to
search for the definition to determine that it is a global, and then
discover that it is also constant. If it were spelt DO_CLEANUP I would
realise it was a global constant and would avoid the search
altogether.
> (Sorry, I'm not arguing for arbitrary semantics, I'm arguing for basically the
> same semantics as the linux kernel uses...)
The popularity of the Linux kernel aside, I don't like a style that
makes a constant indistinguishable from a variable.
Cheers,
Shaun
More information about the busybox
mailing list