From 33791f1f4b3b880921fb80e00cde6e5a1e37806f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 16 Oct 2025 17:03:38 +0200 Subject: [PATCH] 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. --- conf/cf-lex.l | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.47.3