From a4e1066ca7a1791973b8f3af60f6c1faace14cb0 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Thu, 24 Aug 2023 20:18:03 -0600 Subject: [PATCH] util/kconfig: Update toada to halt on errors The tool 'toada' which converts the Kconfig output to ada syntax keeps running even when it can't parse something. Change that behavior to halt, and update the error message to show where the error is coming from. Signed-off-by: Martin Roth Change-Id: I29807a054581060d04b9ecbe02f2ba666c46bcf2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77422 Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas Reviewed-by: Felix Singer --- util/kconfig/toada.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/kconfig/toada.c b/util/kconfig/toada.c index 02b6351c5d..b5312963c5 100644 --- a/util/kconfig/toada.c +++ b/util/kconfig/toada.c @@ -4,6 +4,7 @@ #include #include #include +#include static void print_bool(const char *const name, const bool val) { @@ -107,8 +108,9 @@ int main(int argc, char *argv[]) print_dec(name, val); } else { fprintf(stderr, - "couldn't parse value '%s' for '%s'\n", + "toada: Error: Couldn't parse value '%s' for '%s'\n", val, name); + exit(1); } continue; default: