Hacker GitHub

← All repos

rurban/safeclib

View on GitHub ↗ ★ 406 C

safec libc extension with all C11 Annex K functions

24 mentions on Hacker News by 5 people: 2 stories, 22 comments · first 2017-04-13 · latest 2025-11-17

Mentions per year 24 mentions · busiest year 2018 (11)
20082026
  1. Just don't mix that up with the real safec.h header from safeclib: https://github.com/rurban/safeclib/tree/master/include
  2. …Eg my C memcpy with inlined and vectorized clang beats glibc or gcc memcpy in assembler easily. https://github.com/rurban/safeclib/blob/master/tests/perf_me...
  3. …me a day. Now just the secure scanf family is missing, and this needs locale support unfortunately. https://github.com/rurban/safeclib/blob/master/src/str/vsnpr...
    comment by rurban · 2022-02-26 · in Curious lack of sprintf scaling
  4. …variants are not only insecure, but also slow. (byte wise!) Only safelibc has a secure memset_s. https://github.com/rurban/safeclib/blob/master/tests/perf_me...
  5. …are simpler, more feature-rich, or both. * https://github.com/intel/safestringlib (MIT licensed) * https://github.com/rurban/safeclib (MITish) * https://github.com/mpedrero/safeString (MIT licensed) * https://github.com/antirez/sds (BSD…
    comment by cestith · 2021-03-04 · in Git's list of banned C functions
  6. …;-) You can link one of these libraries against your code on Linux to get the Safe C functions: https://github.com/rurban/safeclib https://sourceforge.net/p/safeclib/code/ci/master/tree/ Changing an existing code base from the normal glibc…
  7. …p://ftp.openwatcom.org/manuals/current/clib.pdf [2] Safe C Library — A full implementation of Annex K https://github.com/rurban/safeclib/ [3] slibc https://code.google.com/archive/p/slibc/
  8. …CI was doing it similar. setups: https://github.com/LibreDWG/libredwg/blob/master/build-aux/s... https://github.com/rurban/safeclib/blob/master/build-tools/s...
    comment by rurban · 2019-01-24 · in Wine 4.0 released
  9. AFAIK my own memset_s is the only secure one: https://github.com/rurban/safeclib/tree/master/src/mem but nobody cares. It was not mentioned at this years CCC talk about memset. Everybody thinks a simple compiler barrier is enough, it is…
    comment by rurban · 2019-01-20 · in Inside the C Standard Library
  10. …are getting too tricky, and I'm not sure when memset-like functions are just optimized away. https://github.com/rurban/safeclib/commits/smoke
  11. Not an alternative, but an addon: https://github.com/rurban/safeclib for the secure Annex K extensions (the _s variants) The only safer alternatives are the Microsoft Windows msvcrt and ulibc w/ secure API, Android Bionic and Embarcadero…
  12. …because there g++ is not as broken as gcc with constexpr, but clang since 5.0 is doing fine. https://github.com/rurban/safeclib
  13. …and clang decent. So I'm not sure if using the builtin assembler would fix the gcc situation. 1: https://github.com/rurban/safeclib/blob/master/tests/perf_me...
  14. It is even C11: https://github.com/rurban/safeclib/blob/master/src/str/strcp...
    comment by rurban · 2018-09-01 · in Stop using strncpy already (2013)
  15. To the downvoters: This is the benchmark where GCC looses big time to clang: https://github.com/rurban/safeclib/blob/master/tests/perf_me... My clang compiled memcpy_s is faster than the handoptimized glibc assembler and twice as fast than…
    comment by rurban · 2018-07-27 · in GCC 8.2 Released
  16. The mentioned Safe C Library is now at https://github.com/rurban/safeclib
  17. …truncating variants and changed the implementation to always terminate the asciiz string properly. https://github.com/rurban/safeclib/blob/master/src/str/strnc...
    comment by rurban · 2018-06-06 · in Beware of strncpy and strncat
  18. …clang >4, beating the handoptimized and unsafe glibc assembler version by ~5%. gcc stinks there. https://github.com/rurban/safeclib/blob/master/tests/perf_me... Let the compiler optimize it. But I saw much faster memcpy than this.
  19. …in safeclib, which is written in pure C99 without asm, getting the same speed as glibc on clang-7. https://github.com/rurban/safeclib on top of an existing unsafe libc, if glibc, bsd, musl or windows msvcrt/ulibc.
  20. This is based on Cisco's safeclib, and the latest uptodate version is here: https://github.com/rurban/safeclib
    comment by rurban · 2018-02-23 · in Intel's Safe String Library
  21. …has a proper testsuite for their libc. Glibc is somewhat ok, but I still find crashes daily. https://github.com/rurban/safeclib So why is nobody else implementing C11? I'll write a blog post when I finished my C11 efforts. Maybe at least…
  22. I forked it at https://github.com/rurban/safeclib Besides the mentioned critism there are several outstanding issues I'll fix: add sprintf_s, fix strljustify_s from the 2 unmerged merge requests. fix memset_s API to be C11 compatible.
    comment by rurban · 2017-04-13 · in The Safe C Library (2009)