Skip to content

Added compile-time warning for GUIX deprecated string API#167

Open
fdesbiens wants to merge 1 commit into
eclipse-threadx:devfrom
fdesbiens:fdesbiens/flag-deprecations
Open

Added compile-time warning for GUIX deprecated string API#167
fdesbiens wants to merge 1 commit into
eclipse-threadx:devfrom
fdesbiens:fdesbiens/flag-deprecations

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

Summary

When GX_DISABLE_DEPRECATED_STRING_API is not defined, gx_api.h now emits a #pragma message compile-time warning directing developers to define GX_DISABLE_DEPRECATED_STRING_API and migrate to the GX_STRING-based (_ext) replacement functions.

The pre-5.6 GX_CHAR * API omits string lengths and cannot safely handle non-NUL-terminated strings or prevent buffer overruns. All new applications should use the replacement variants.

Changes

  • common/inc/gx_api.h: added #pragma message inside the #ifndef GX_DISABLE_DEPRECATED_STRING_API block.

Companion

Docs: eclipse-threadx/rtos-docs-asciidoc#33 (pending)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant