7

The C11 standard Annex K defines a bunch of new safer string functions, all suffixed by _s (e.g. strcpy_s).

Do you know when these new functions will become available in the GNU C library glibc?

So far you have to fall back to a third party library like safec.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
samba2
  • 468
  • 7
  • 15
  • 3
    The annex is optional. And why don't you ask this at the GCC's project site? – too honest for this site Jul 12 '16 at 07:44
  • 1
    A document of interest → http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm – Picodev Jul 12 '16 at 09:35
  • I'm voting to close this question as primarily opinion-based because only the glibc developers and maintainers can answer this question. – JAL Jul 12 '16 at 14:59
  • @olaf because GCC has nothing to do with glibc? – rubenvb Jul 12 '16 at 15:03
  • @rubenvb: Please read the homepage of the GNU Compiler Collection **project**! You are wrong! GCC != gcc! – too honest for this site Jul 12 '16 at 15:04
  • These functions aren't all that great as they're made out to be. See for example, [thi write-up](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm). – rubenvb Jul 12 '16 at 15:11
  • @olaf: The GCC project page, http://gcc.gnu.org, contains exactly zero references to glibc. What are you on about? Glibc is not part of the GCC project. – rubenvb Jul 12 '16 at 15:58
  • @rubenvb: The page is not well sorted, I agree. However, according to the intro text: "The GNU Compiler Collection includes front ends for **C**, C++, Objective-C, Fortran, Java, Ada, and Go, **as well as libraries for these languages** (libstdc++, libgcj,...). ". And I have in mind that they also maintain glibc. However, I could not find a direct link quickly. Anyway, then ask GNU, resp. the glibc maintainers directly. Whoever the maintainer is, stack overflow is definitively not, nor the support forum. – too honest for this site Jul 12 '16 at 16:44
  • 3
    There is *nothing* opinion-based in this question, and the answer I gave is precise and correct. I don't understand all the down-votes. Source: I *am* a GLIBC developer. – Employed Russian Jul 13 '16 at 02:20
  • Note that safec is now here: https://github.com/rurban/safeclib with all C11 Annex K functions. Can be used together with glibc or any other libc to get the secure Annex K functions – rurban Oct 16 '17 at 10:12
  • This is the GNU and Standards and coding world just shooting itself in the foot. If you have the online docs (ie what folks use when they look up C strcpy_s for example, declare it is part of C11 ( https://en.cppreference.com/w/c/string/byte/strcpy ) then it is right that a user expects compilers claiming to implement C11 to have that as part of the implementation. When G++ for example claimns to cover C11, such as as of GCC 4.7, then I think its right for the programmer to expect GCC 4.7 will compile code with strcpy_s in it. And not complain about "undefined". – Minok Jun 10 '21 at 22:13

1 Answers1

4

Do you know when these new functions will become available in the GNU C library glibc?

When someone contributes an implementation and convinces GLIBC maintainers that these functions are good to have.

Relevant thread from 2007.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362