[libc-commits] [libc] [libc] Add printf error handling (PR #162876)
Marcell Leleszi via libc-commits
libc-commits at lists.llvm.org
Thu Oct 23 04:15:34 PDT 2025
================
@@ -132,14 +144,6 @@ template <typename T> LIBC_INLINE constexpr TypeDesc type_desc_from_type() {
// This is the value to be returned by conversions when no error has occurred.
constexpr int WRITE_OK = 0;
-// These are the printf return values for when an error has occurred. They are
-// all negative, and should be distinct.
-constexpr int FILE_WRITE_ERROR = -1;
-constexpr int FILE_STATUS_ERROR = -2;
-constexpr int NULLPTR_WRITE_ERROR = -3;
-constexpr int INT_CONVERSION_ERROR = -4;
-constexpr int FIXED_POINT_CONVERSION_ERROR = -5;
-constexpr int ALLOCATION_ERROR = -6;
----------------
mleleszi wrote:
I've added specific implementation for linux and a generic one for baremetal and the other platforms. Also added one for darwin, which is the same as the linux one...is that OK? We should be able to provide a POSIX api on MacOS, right? If so, we should probably define EOVERFLOW in our generic error macros?
https://github.com/llvm/llvm-project/pull/162876
More information about the libc-commits
mailing list