RTEMS | Add check for allowed C Library Functions in Core Parts of RTEMS (#5238)

Joel Sherrill (@joel) gitlab at rtems.org
Thu Apr 17 23:31:24 UTC 2025



Joel Sherrill created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5238



## Summary
Historically, only a very small set of C Library functions were allowed to be called from the score, sapi, and rtems. Originally this set was empty but it has grown to allow memcpy(), memset(), and memmove(). Discussion of using gmtime_r() has made it clear that we need to:

- [ ] - Document the list of allowed functions and locations under the restriction. Document these rules in the Software Engineering Guide
- [ ] - Add tool to enforce the rules.

The rule can be expressed as only allowing the include of string.h (for mem*) and time.h (for gmtime_r) and then checking for the other functions which are defined by C11 to be in these headers. Only these four functions are allowed to be called.


### Pre-set options

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5238
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/20250417/f4514ec9/attachment-0001.htm>


More information about the bugs mailing list