]> localhost Git - gists.git/commitdiff
Add freestanding libc notes
authormisomosi <[email protected]>
Wed, 27 May 2026 18:12:27 +0000 (14:12 -0400)
committermisomosi <[email protected]>
Wed, 27 May 2026 18:24:24 +0000 (14:24 -0400)
FSLibcNotes/README.md [new file with mode: 0644]

diff --git a/FSLibcNotes/README.md b/FSLibcNotes/README.md
new file mode 100644 (file)
index 0000000..81cbefc
--- /dev/null
@@ -0,0 +1,58 @@
+# Freestanding libc notes
+
+Notes I have for using libc functions even in a freestanding environment
+
+## Allowable Headers in Freestanding environment
+
+These headers are allowable because they're computation
+or compiler/language-based and implementable without
+arch/OS-specific support.
+
+* ctype.h
+* stdckdint.h
+* errno.h
+* float.h
+* inttypes.h
+* iso646.h
+* limits.h
+* math.h
+* stdalign.h
+* stdarg.h
+* stdbit.h
+* stdbool.h
+* stdalign.h
+* stdcountof.h
+* stddef.h
+* stdint.h
+* stdmchar.h
+* stdnoreturn.h
+* string.h
+* stdlib.h
+* tgmath.h
+* uchar.h
+* wchar.h
+* wctype.h
+
+## Semi-Allowable Headers in Freestanding Environments:
+
+These headers are allowable, but with caveats because
+some functions rely on functionality via arch/OS-specific support
+
+* stdlib.h (Process control functions are not allowed)
+* stdio.h (FILE objects are not allowed, printf is allowed)
+* time.h (Time manipulation is not allowed)
+
+## Non-Allowable Headers in Freestanding Environments
+
+These headers are generally not allowed because they're
+hard to implement without arch/OS-specific support, they're
+optional in std C, they're tricky/bad practice, etc.
+
+* assert.h    (Hard to implement without process control)
+* complex.h   (Optional in std C)
+* fenv.h      (Hard to implement without arch-specific support)
+* stdatomic.h (Optional in std C)
+* threads.h   (Optional in std C)
+* signal.h    (UNIX-only)
+* setjmp.h    (Hard to implement without arch-specific support)
+* locale.h    (Introduces inconsistencies and gotchas in I/O)