From 9c309400fca07f15d8f4b116c12fa58f97d8043a Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 28 Jan 2018 10:02:20 +0100 Subject: Add some post-parsing warnings These are easiest to check after parsing, since a symbol/choice can be defined in multiple locations: - Warn if a symbol or choice defined without a type. Also warn for choice value symbols defined without a type, even if they automatically get their type from the choice. This feature isn't well-known and probably not used deliberately. - Warn if a choice is defined without a prompt - Warn of a choice default symbol is not contained in the choice Also move _name_and_loc_str() from the symbol class to the global scope and generalize it to be able to handle choices. --- tests/Kassignable | 1 + tests/Kdefconfig_existent_but_n | 1 + tests/Khelp | 3 +++ tests/Klocation | 2 ++ tests/Klocation_included | 3 +++ 5 files changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/Kassignable b/tests/Kassignable index f134a74..26b4177 100644 --- a/tests/Kassignable +++ b/tests/Kassignable @@ -9,6 +9,7 @@ if UNDEFINED && "const" endif config NO_PROMPT + bool config STRING string "string" diff --git a/tests/Kdefconfig_existent_but_n b/tests/Kdefconfig_existent_but_n index 17b8980..2d55e97 100644 --- a/tests/Kdefconfig_existent_but_n +++ b/tests/Kdefconfig_existent_but_n @@ -2,6 +2,7 @@ # Should produce None due to the "depends on n" config FOO + string option env="BAR" config A diff --git a/tests/Khelp b/tests/Khelp index fdc81ed..c201176 100644 --- a/tests/Khelp +++ b/tests/Khelp @@ -1,4 +1,5 @@ config TWO_HELP_STRINGS + bool help first help string @@ -10,10 +11,12 @@ config TWO_HELP_STRINGS second help string config NO_BLANK_AFTER_HELP + bool help help for NO_BLANK_AFTER_HELP choice CHOICE_HELP + bool "choice with help" help help for CHOICE_HELP diff --git a/tests/Klocation b/tests/Klocation index 3901ebf..00d4f4a 100644 --- a/tests/Klocation +++ b/tests/Klocation @@ -2,8 +2,10 @@ if UNDEFINED endif config SINGLE_DEF + bool config MULTI_DEF + bool # Throw in some line continuations too to make sure it doesn't mess up the line # numbers diff --git a/tests/Klocation_included b/tests/Klocation_included index fb1afaa..6e19f76 100644 --- a/tests/Klocation_included +++ b/tests/Klocation_included @@ -3,13 +3,16 @@ config MULTI_DEF choice CHOICE + bool "choice" endchoice config MENU_HOOK + bool menu "menu" endmenu config COMMENT_HOOK + bool comment "comment" -- cgit v1.2.3