Nice kconfig hack
Rich Felker
dalias at aerifal.cx
Wed May 2 15:27:47 UTC 2012
On Wed, May 02, 2012 at 10:10:43AM -0500, Rob Landley wrote:
> On 04/26/2012 08:03 AM, Lauri Kasanen wrote:
> > Hi
> >
> > Linus asked for a better way to handle the kconfig values:
> > https://plus.google.com/102150693225130002912/posts/9gntjh57dXt
> >
> > The solution is rather neat, maybe it could save generating a few
> > thousand included lines in busybox too:
> >
> > #define is_set(macro) is_set_(macro)
> > #define macrotest_1 ,
> > #define is_set_(value) is_set__(macrotest_##value)
> > #define is_set__(comma) is_set___(comma 1, 0)
> > #define is_set___(_, v, ...) v
>
> It's clever, but there's a problem:
>
> Right now, if you leave in a test for a symbol that's been removed, or
> if you typo a symbol name, the build will break. And this is good, it
> shows you what needs fixing.
>
> With this new mechanism, testing for a symbol that _can't_ ever be set
> means there's dead code in the source which the compiler won't warn you
> about.
>
> *shrug* Maybe it's still worth doing, not my call...
I would just institute a policy of "grep -r" whenever a test symbol is
removed... That's a lot cheaper than maintaining busybox's current
config monstrosity.
Rich
More information about the busybox
mailing list