Skip to content

Commit 6442985

Browse files
committed
change clarifying comment
1 parent 86d149a commit 6442985

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libc/include/llvm-libc-types/errno_t.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
#ifndef LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_ERRNO_T_H
1010
#define LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_ERRNO_T_H
1111

12-
// LIBC_HAS_ANNEX_K is a necessary check guard here because errno_t is only
13-
// defined when Annex K is enabled. We use LIBC_HAS_ANNEX_K internally to
14-
// indicate whether Annex K is enabled or not.
12+
// LIBC_HAS_ANNEX_K is used to check whether C11 Annex K (the optional
13+
// “Bounds-checking interfaces”) is enabled in this libc implementation. Annex K
14+
// introduces additional types and functions, including `errno_t` (a typedef
15+
// used by the *_s functions). Since `errno_t` is *not defined* in the standard
16+
// library unless Annex K is enabled, we must guard any code that uses it with
17+
// LIBC_HAS_ANNEX_K.
1518
#ifdef LIBC_HAS_ANNEX_K
1619

1720
typedef int errno_t;

0 commit comments

Comments
 (0)