Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable __STDC_WANT_LIB_EXT1__ to get memset_s
As we switch to C11, the availability of the memset_s function under Macos is detected by autoconf. The explicit_bzero.c module will use it to implement explicit_bzero(3) on that system. According to N1570, Annex K, in order for the string.h header to declare memset_s(), we need to define __STDC_WANT_LIB_EXT1__ as 1 before including the header file. The libc implementation is in turn supposed to define __STDC_LIB_EXT1__ in the header, to claim that the interfaces of Annex K are implemented as dictated by the standard. In theory, we should be using memset_s() only if __STDC_LIB_EXT1__ is defined, but we know that memset_s() exists thanks to autoconf. Since the Macos libc does not define __STDC_LIB_EXT1__, we can not be 100% sure that the memset_s() function is implemented in a standard way.
- Loading branch information