From: Ondrej Zajicek Date: Thu, 16 Oct 2025 15:03:38 +0000 (+0200) Subject: Conf: Add warning for symbol overriding keyword X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33791f1f4b3b880921fb80e00cde6e5a1e37806f;p=thirdparty%2Fbird.git Conf: Add warning for symbol overriding keyword In BIRD configuration, used-defined symbols can override keywords, which could lead to an unexpected behavior when one tries to use such keyword in its original meaning. --- diff --git a/conf/cf-lex.l b/conf/cf-lex.l index f13b1c12b..0bf76e9b1 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -647,6 +647,9 @@ cf_localize_symbol(struct config *conf, struct symbol *sym) if (cf_symbol_is_local(conf, sym)) cf_error("Symbol '%s' already defined", sym->name); + if (sym->class == SYM_KEYWORD) + cf_warn("Symbol '%s' overrides existing keyword", sym->name); + /* Not allocated here yet, doing it now. */ cf_swap_soft_scope(conf); return cf_new_symbol(conf->current_scope, conf->pool, conf->mem, sym->name);