Skip to contentSkip to conversation

2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs

PATCH Adam J. Richter 3 participants 3 messages Jul 2, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines
Quoted 1 line · Adam J. Richter

Can you even write a hypothetical example?

if [ "$CONFIG_foo" = "n" -a "$CONFIG_bar" = "n" ]; then
define_bool "$CONFIG_ALLOW_foo_bar n
fi
....
dep_tristate CONFIG_baz $CONFIG_ALLOW_foo_bar

In linux-2.4.6-pre8, there are only three configuration variables
that are defined with an indented 'define_bool' statement (CONFIG_BLK_DEV_IDE{DMA,PCI}, and CONFIG_PCI), and the conditional code execute by all "if" statements in all of the config.in files appears to be indented (or at least the first statement in the block is indented). None of these three variables has the semantics that I think you you described above.

If you want to check, I determined this by the following shell
commands:

% find . -iname config.in | xargs egrep dep_tristate | tr '   ' '\n\n' | egrep '^\$CONFIG_' | sort -u > /tmp/config-dependencies 
% find . -iname config.in | xargs egrep '^[   ].*define_bool' | fgrep -f /tmp/config-dependencies  | awk '{print $(NF-1)}' | sort -u

CONFIG_BLK_DEV_IDEDMA
CONFIG_BLK_DEV_IDEPCI
CONFIG_PCI
% find /usr/src/linux/ -iname config.in | xargs egrep -A 2 ^if | egrep -v -e -- | egrep '^-[^ ]'
%

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
[email protected]     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America

fax +1 408 261-6631 "Free Software For The Rest Of Us."

#1 lore raw
Quoted 7 lines · Adam J. Richter

In linux-2.4.6-pre8, there are only three configuration variables
that are defined with an indented 'define_bool' statement (CONFIG_BLK_DEV_IDE{DMA,PCI}, and CONFIG_PCI), and the conditional code execute by all "if" statements in all of the config.in files appears to be indented (or at least the first statement in the block is indented). None of these three variables has the semantics that I think you you described above.

A conditioned define_bool is not the only possibility, that was just one example. Undefined variables can be created by any of the ask, define, dependent or choice statements listed in Documentation/kbuild/config-language.txt, when that statement is not executed. The reason for not being executed can be an 'if' statement or the code can be in a file that is not read, either the 'source' statement is bypassed or it is for another architecture. Also the unset statement changes variables to undefined values.

Identifying where variables can have unset values cannot be done by a grep of the files. You have to follow every branch of the condition tree, including source statements, eliminate those variables where every branch assigns a value before it is used then flag the remainder as "may be used while uninitialized".

#2 lore raw
In reply to Adam J. Richter
Quoted 3 lines

appears to be indented (or at least the first statement in the block is indented). None of these three variables has the semantics that I think you you described above.

Ok so that just leaves fixing any Xconfig/menuconfig versions of the change and it can go in

Excellent