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
20082026
-
Just don't mix that up with the real safec.h header from safeclib: https://github.com/rurban/safeclib/tree/master/include
comment by rurban · 2025-11-17 · in Giving C a superpower: custom header file (safe_c.h) -
…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...
comment by rurban · 2023-05-22 · in LLVM's Libc Gets Much Faster memcpy For RISC-V -
▲ 12
Safeclib – C11 Annex K implementationstory by synergy20 · 2022-08-25 · 2 comments
-
…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 -
…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...
comment by rurban · 2021-11-14 · in A 100LOC C impl of memset, that is faster than glibc's -
…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 -
…;-) 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…
comment by randomhacker123 · 2020-12-19 · in When DevSecOps goes wrong: a short lesson from Huawei's source code -
…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/
comment by rseacord · 2020-04-14 · in Tell HN: C Experts Panel – Ask us anything about C -
…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 -
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 -
…are getting too tricky, and I'm not sure when memset-like functions are just optimized away. https://github.com/rurban/safeclib/commits/smoke
comment by rurban · 2018-12-23 · in Schedule – 35th Chaos Communication Congress -
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…
comment by rurban · 2018-11-19 · in Ask HN: Safe alternative to the C stdlib? -
…because there g++ is not as broken as gcc with constexpr, but clang since 5.0 is doing fine. https://github.com/rurban/safeclib
comment by rurban · 2018-11-13 · in C2x: the next real revision of the C standard -
…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...
comment by rurban · 2018-10-08 · in How newlines affect Linux kernel performance -
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) -
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 -
The mentioned Safe C Library is now at https://github.com/rurban/safeclib
comment by rurban · 2018-07-22 · in Conflating pointers with arrays: C's biggest mistake? (2009) -
…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 -
…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.
comment by rurban · 2018-05-05 · in Memcmp is the most efficient way to compare large chunks of data -
…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.
comment by rurban · 2018-03-08 · in Sulong: Finding Errors in C Programs [pdf] -
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 -
▲ 2
Safeclib-3.0 released, the first and only C11 AnnexK safe libcstory by rurban · 2017-10-04 · 0 comments
-
…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…
comment by rurban · 2017-09-06 · in Some Were Meant for C: The Endurance of an Unmanageable Language [pdf] -
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)