Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using c11 #336

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Using c11 #336

merged 2 commits into from
Jan 28, 2025

Conversation

dacav
Copy link
Contributor

@dacav dacav commented Jan 24, 2025

No description provided.

@dacav dacav requested a review from LDVG January 24, 2025 08:03
dacav added 2 commits January 24, 2025 13:48
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.
@LDVG LDVG merged commit 7dbddf0 into main Jan 28, 2025
29 checks passed
@LDVG LDVG deleted the dacav/std=c11 branch January 28, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants