Re: [patch] config language dep_* enhancements

From: Greg Banks (gnb@alphalink.com.au)
Date: Tue Aug 13 2002 - 21:27:01 EST


Peter Samuelson wrote:
>
> [Greg Banks]
> > Does "complete" mean all the ports have also made the change and
> > been merged back?
> [...]
> Actually I suspect it would be more like the C99 thing: after the new
> syntax is added, we start doing [TRIVIAL] patches to clean out the
> old, and eventually once that is done we have the option of removing
> the old syntax or leaving it in as a known oddity. [...]

Fair enough.

> > I'm more concerned about subtle dependencies on execution order
> > resulting from misuse of conditionals.
>
> Yeah, that's the real reason 'n'!='' is Considered Harmful (and warned
> about in the docs even now).

There are issues regardless of the behaviour of "". For example, here's
one of at least 8 ways I've identified where things can go wrong when
conditionals are misused.

#
# Testing mixed overlap, type 1
# (mixed overlap, define first, query conditional, same menu)
#

mainmenu_option next_comment
comment 'xconfig needs this menu'

    define_bool CONFIG_QUUX y

    bool 'Set this symbol to ON' CONFIG_FOO

    if [ "$CONFIG_FOO" = "y" ]; then
        bool 'Here QUUX is a query symbol' CONFIG_QUUX
    fi

endmenu

# Expected semantics:
# FOO=n => QUUX not asked, is y.
# FOO=y => QUUX asked, default y, can be either y or n.
# so list of valid configs is:
# QUUX=y FOO=n
# QUUX=y FOO=y
# QUUX=n FOO=y

# Actual semantics, "make config"
# FOO=n => QUUX not asked, is y (CORRECT)
# FOO=y => QUUX asked, default y,
# if y appears twice with same value (INCORRECT)
# if n appears twice with different values (INCORRECT)
# list of produced configs:
# QUUX=y FOO=n
# QUUX=y FOO=y QUUX=y
# QUUX=y FOO=y QUUX=n

# Actual semantics, "make menuconfig"
# FOO=n => QUUX not asked, is y (CORRECT)
# FOO=y => QUUX asked, default y,
# if y appears twice with same value (INCORRECT)
# cannot set to n (INCORRECT)
# list of produced configs:
# QUUX=y FOO=n
# QUUX=y FOO=y QUUX=y

# Actual semantics, "make xconfig"
# FOO=n => QUUX not asked
# on save, get "ERROR - Attempting to write value for unconfigured variable (CONFIG_QUUX)"
# does not save QUUX at all (INCORRECT)
# FOO=y => QUUX asked, default y,
# if y appears twice with same value (INCORRECT)
# cannot set to n (INCORRECT)
# list of produced configs:
# FOO=n
# QUUX=y FOO=y QUUX=y

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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 15 2002 - 22:00:35 EST