From c8b0df940a586dda9334c48e085da7482c79b977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Desbiens?= Date: Wed, 24 Jun 2026 09:05:46 -0400 Subject: [PATCH] Added compile-time warning for GUIX deprecated string API When GX_DISABLE_DEPRECATED_STRING_API is not defined (i.e., the pre-5.6 GX_CHAR* API is still enabled), gx_api.h now emits a #pragma message directing developers to define GX_DISABLE_DEPRECATED_STRING_API and migrate to the GX_STRING-based replacement functions. The deprecated functions omit a string length and cannot safely handle non-NUL-terminated strings or prevent buffer overruns. All new applications should use the _ext() replacement variants. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- common/inc/gx_api.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/inc/gx_api.h b/common/inc/gx_api.h index 7e3e4e94a..e78d1e911 100644 --- a/common/inc/gx_api.h +++ b/common/inc/gx_api.h @@ -132,6 +132,10 @@ typedef struct GX_STRING_STRUCT #ifndef GX_DISABLE_DEPRECATED_STRING_API #define GX_ENABLE_DEPRECATED_STRING_API +#pragma message("GUIX deprecated string API is enabled. The pre-5.6 char* string " \ + "functions do not carry a length and are unsafe with non-NUL-terminated " \ + "buffers. Define GX_DISABLE_DEPRECATED_STRING_API and migrate to the " \ + "GX_STRING-based (_ext) variants.") #endif #if defined(GX_THREADX_BINDING)