Re: [PATCH v11 24/65] dyndbg: check DYNAMIC_DEBUG_CLASSMAP_DEFINE args at compile-time

From: Louis Chauvet

Date: Fri Mar 20 2026 - 12:45:19 EST


On Fri, 13 Mar 2026 07:19:49 -0600, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
> diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c
> index 1ba4be9a403a..b2bdfdfb6ba1 100644
> --- a/lib/test_dynamic_debug.c
> +++ b/lib/test_dynamic_debug.c
> @@ -146,8 +146,19 @@ DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_CORE");
> [ ... skip 4 lines ... ]
> +/*
> + * Exersize compile-time arg-checks in DYNAMIC_DEBUG_CLASSMAP_DEFINE.
> + * These will break compilation.
> + */
> +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_neg, 0, -1, "NEGATIVE_BASE_ARG");
> +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_big, 0, 100, "TOOBIG_BASE_ARG");

Maybe add a:

DYNAMIC_DEBUG_CLASSMAP_DEFINE(cat_disjoint_bits, 0, 61, "TOOLONG");

So you can also check that an overflow is really checked.

--
Louis Chauvet <louis.chauvet@xxxxxxxxxxx>