[libc-commits] [libc] [libc][stdio] Add fopen_s and bootstrap annex k. (PR #152248)

Muhammad Bassiouni via libc-commits libc-commits at lists.llvm.org
Fri Aug 8 09:06:07 PDT 2025


================
@@ -0,0 +1,19 @@
+//===-- Definition of macros to be used with Annex K functions ------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_INCLUDE_LLVM_LIBC_MACROS_ANNEX_K_MACROS_H
+#define LLVM_LIBC_INCLUDE_LLVM_LIBC_MACROS_ANNEX_K_MACROS_H
+
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L &&                \
+    defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ == 1
----------------
bassiounix wrote:

These are the only places where I could find `__STDC_VERSION__`:
- https://github.com/llvm/llvm-project/blob/main/libc/include/llvm-libc-types/char16_t.h
- https://github.com/llvm/llvm-project/blob/main/libc/include/llvm-libc-types/char32_t.h
- https://github.com/llvm/llvm-project/blob/main/libc/include/llvm-libc-macros/stdint-macros.h

It's macro related stuff only, not core code.

So from what I found, I think the answer is: no, not really.

I could remove this specific check, but isn't this against the specification? shouldn't we be as compatible with the standard as possible?
We talked earlier about "standard-compliant" implementation and MSVC, that's why I am bringing it here again.
Michael said that the goal is not to provide the most compatible implementation libc but a useful libc.

What do you think?

https://github.com/llvm/llvm-project/pull/152248


More information about the libc-commits mailing list