I'm having trouble using strerrorlen_s in gcc 4.7.2 even though I defined __STDC_WANT_LIB_EXT1__ 1.
What is the oldest version of gcc/glibc that supports the strerrorlen_s and strerror_s functions?
1.9k Views Asked by clockley1 At
2
There are 2 best solutions below
2
On
N1570 Committee Draft — April 12, 2011 ISO/IEC 9899:201x
errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
size_t strerrorlen_s(errno_t errnum);
size_t strnlen_s(const char *s, size_t maxsize);
That's from my copy of the C11 standard - draft N1570. Maybe later versions of gcc have it... So we are not both crazy....
It's not in glib 2.13, at least under Debian, but I can't see why that would be different to any other system. A search for
strerrorlen_son the whole disk returns nothing.It's also not listed in any of the release notes for 2.14 through the current 2.17 (searched for
bounds,tr24731andstrerrorlen_s). It's not even mentioned on the 2.18 wiki page.Keep in mind that the bounds checking interfaces are an optional feature of C11. Annex K details this, and implementations are not required to provide it at all.
It looks like there are actually no plans to support this feature in the core
glibcat all. From a comment by Ulrich Drepper (admittedly March 2012) on whether support would be forthcoming:Similarly, from an LNW article around the same time: