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

Aaron Ballman via libc-commits libc-commits at lists.llvm.org
Fri Aug 8 10:38:47 PDT 2025


================
@@ -0,0 +1,21 @@
+//===-- Definition of type constraint_handler_t ---------------------------===//
+//
+// 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_TYPES_CONSTRAINT_HANDLER_T_H
+#define LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_CONSTRAINT_HANDLER_T_H
+
+#include "errno_t.h"
+
+#ifdef LIBC_HAS_ANNEX_K
+
+typedef void (*constraint_handler_t)(const char *__restrict msg,
+                                     void *__restrict ptr, errno_t error);
----------------
AaronBallman wrote:

My comment was more general than just the typedef. The standard specifies the names of the functions themselves and what their type signature is, but the names of parameters are not mandated by the standard. We should avoid stealing identifiers from the user's namespace to the greatest extent possible, so I'd expect all internal implementation details (parameter names, macro parameter names, internal macro names, etc) to be using reserved identifiers so they don't conflict with user-declared identifiers (macros in particular).

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


More information about the libc-commits mailing list