https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88700
Bug ID: 88700
Summary: C11 Annex K builtins
Product: gcc
Version: 8.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jg at jguk dot org
Target Milestone: ---
Would GCC consider adding C11 Annex K safe functions as builtins?
I feel they would be very useful. Currently only we use them on MSCV builds.
Clang is thinking of adding these bultins - this is where the thread began
http://lists.llvm.org/pipermail/cfe-dev/2016-February/047149.html
As JF explains, they can just wrap regular builtins
(memcpy_s, memmove_s, strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s,
memset_s, strerror_s, strerrorlen_s, strnlen_s)
Saw this list of current GCC builtins
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
glibc "stdint.h" would need this adding as well - should I open a glibc ticket
for that proposed change?
My code below:
#ifdef (__STDC_WANT_LIB_EXT1__)
#if __STDC_WANT_LIB_EXT1__ >= 1
#define RSIZE_MAX (SIZE_MAX >> 1)
#endif
#endif