G'day,

A couple of people have asked me how I'm finding all the kconfig
problems for which I've been submitting trivial patches, so I thought
I'd post a few words about the tool I'm using.

I've written a CML1 parsing backend for gcml2, my C implementation
of CML2.  Getting a bison parser to swallow CML1 was not difficult,
but munging the data structures thus generated into rulebase structures
designed for CML2 was interesting.  In the process I learnt a lot
about CML1, most of it stuff I would rather not have learnt.

I've also created a new program which uses this parser to parse and
merge all 17 CML1 config trees together, finding global problems like
symbols which are never defined.

Below is a summary of the warnings produced by the CML1 checker run
over 2.5.24 (plus the patches I've posted since .24).  Note that
these numbers should be considered an approximation.  The checker
both overcounts some warnings (ambiguous comparisons are counted
once for each arch tree they appear in, so a single line can result
in 17 warnings) and undercounts others (forward references are only
counted the first time a symbol is referenced).

11      crud after bool
        Symbol references or tristate constants appearing after
        the last valid argument in a "bool" or "tristate" statement,
        either because someone thought they were using "dep_bool"
        or because they thought that "bool" takes a default value
        argument like "hex" and "string".

13      missing obsolete tag
        A symbol depends on CONFIG_OBSOLETE but does not say so in
        it's banner.  Interestingly, CONFIG_OBSOLETE is itself never
        defined.

565     missing experimental tag
        A symbol depends on CONFIG_EXPERIMENTAL but does not say so
        in it's banner.  The large number is due to whole menu subtrees
        being sourced inside "if".
        
41      spurious obsolete tag
        A symbol's banner says it depends on CONFIG_OBSOLETE but it
        doesn't.

111     forward reference
        A symbol was used before it was defined.  This counts three
        different cases: 1) poor menu design (e.g. CONFIG_ACPI and
        CONFIG_PCI) 2) a symbol cross-referenced from another arch
        tree (e.g. CONFIG_SPARC32) or 3) a symbol never defined
        anywhere (e.g. CONFIG_405).

117     spurious experimental tag
        A symbol's banner says it depends on CONFIG_EXPERIMENTAL but
        it doesn't.

60      symbol redefined with different banner
        A symbol was defined multiple times in different arch trees
        or in different branches of "if" statements with different
        banner strings.  A very small number of these could arguably
        be justified; the vast majority are just trivial errors.

21      undeclared symbol
        A symbol was used but never declared in any of the arch trees.

25      variant obsolete tag
        A variant form of the "(OBSOLETE)" tag (e.g. lowercase) was
        used in a symbol's banner.

2602    ambiguous comparison to "n"
        A symbol was used in an "if" statement of the form
        if [ "$CONFIG_FOO" != "n" ], which is ambiguous when the
        symbol has no default value from defconfig.  Some of these
        warnings are spurious because there will always be a value
        for the symbol from defconfig.

115     variant experimental tag
        A variant form of the "(EXPERIMENTAL)" tag (e.g. lowercase) was
        used in a symbol's banner.

As you can see, CML1 is a sick sick puppy and the stuff I've submitted
so far is only the very easiest of the easy fixes.

Greg.
-- 
the price of civilisation today is a courageous willingness to prevail,
with force, if necessary, against whatever vicious and uncomprehending
enemies try to strike it down.     - Roger Sandall, The Age, 28Sep2001.


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to