RTEMS | libcsupport: Add C11 memset_s implementation (!947)

YASH BHIWANIA (@Yash) gitlab at rtems.org
Sat Jan 24 14:45:55 UTC 2026



YASH BHIWANIA created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/947

Project:Branches: Yash/rtems:annex-k-implementation to rtems/rtos/rtems:main
Author:   YASH BHIWANIA




Closes #5434 

## Summary

This MR implements `memset_s()` (Secure Memory Set) as defined in ISO/IEC 9899:2011 Annex K.

## Motivation

RTEMS currently lacks the C11 bounds-checking interfaces. This function provides a secure alternative to `memset` that:

1. Guarantees the write is not optimized away (Dead Store Elimination).
2. Enforces runtime constraints (NULL pointers, `RSIZE_MAX`).

## Implementation Details

* Added `memset_s.c` to `cpukit/libcsupport/src/`.
* Registered the file in `spec/build/cpukit/librtemscpu.yml`.
* Implementation strictly follows C11 K.3.7.4.1.

## Note to Reviewers

This is a baseline implementation intended to support my GSoC 2026 proposal for the full C11 Annex K suite. I welcome feedback on the coding style and integration approach.

<!--Default settings, if it is a dropdown it will set after submission-->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/947
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260124/129550ed/attachment.htm>


More information about the bugs mailing list