From e930c140b424e4f72c6317bedef4ab45079270c9 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 29 Jan 2018 10:46:57 +0100 Subject: Warn if a symbol/choice has multiple prompts In a single location. Having multiple definitions with different prompts is okay. --- kconfiglib.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kconfiglib.py b/kconfiglib.py index 2383fac..621e6c3 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1740,6 +1740,10 @@ class Kconfig(object): node.item.orig_type = new_type if self._peek_token() is not None: + if prompt: + self._warn("{} defined with multiple prompts in single location" + .format(_name_and_loc_str(node.item))) + prompt = (self._expect_str(), self._parse_cond()) elif t0 == _T_DEPENDS: @@ -1831,6 +1835,10 @@ class Kconfig(object): # 'prompt' properties override each other within a single # definition of a symbol, but additional prompts can be added # by defining the symbol multiple times + if prompt: + self._warn("{} defined with multiple prompts in single location" + .format(_name_and_loc_str(node.item))) + prompt = (self._expect_str(), self._parse_cond()) elif t0 == _T_RANGE: -- cgit v1.2.3