From 72f5516270aa576426bc1b3225c8064e444f057a Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Sat, 30 May 2026 10:09:47 +0800 Subject: [PATCH] libnml: gate CMS_DISPLAY_ASCII_UPDATER banner behind debug flag The CMS_DISPLAY_ASCII_UPDATER constructor printed a multi-line 'may not function properly due to range limitations' WARNING banner unconditionally to stderr. That updater is also created transiently by NML::msg2str()/str2msg() to render an otherwise xdr-encoded buffer as an ASCII string (e.g. task command logging under EMC_DEBUG_TASK_ISSUE), so the banner fired during normal startup for a legitimate, harmless use. Route the banner through rcs_print_debug(PRINT_CMS_CONSTRUCTORS, ...) so it is silent by default but still available when CMS constructor debug printing is enabled. Verified the banner no longer appears on a touchy sim started with DEBUG = 0x10 (which instantiates the updater). Surfaced by the ui-smoke tests (PR #4054). --- src/libnml/cms/cms_dup.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libnml/cms/cms_dup.cc b/src/libnml/cms/cms_dup.cc index 85cb81ee87b..ca9f61f785d 100644 --- a/src/libnml/cms/cms_dup.cc +++ b/src/libnml/cms/cms_dup.cc @@ -32,7 +32,12 @@ CMS_DISPLAY_ASCII_UPDATER::CMS_DISPLAY_ASCII_UPDATER(CMS * _cms_parent): CMS_UPDATER(_cms_parent) { - fprintf(stderr, + // This updater is also used transiently by NML::msg2str()/str2msg() for + // ASCII string conversion of otherwise xdr-encoded buffers (e.g. task + // command logging under EMC_DEBUG_TASK_ISSUE), so the banner fired on + // normal startup. Gate it behind the CMS-constructor debug flag instead of + // printing unconditionally to stderr. + rcs_print_debug(PRINT_CMS_CONSTRUCTORS, "* * * * * * * * * * - - - - - WARNING - - - - - * * * * * * * * * *\n" "* CMS_DISPLAY_ASCII_UPDATER may not function properly due *\n" "* to range limitations of some of the update() functions. *\n"