-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Closed
Labels
Description
Including time.h
entrypoints such as asctime
, gmtime
or mktime
results in a compile error:
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/time/asctime.cpp:11:
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/time/time_utils.h:94:16: error: use of undeclared identifier 'EOVERFLOW'
94 | libc_errno = EOVERFLOW;
| ^
1 error generated.
This is because src/time/time_utils.h
unconditionally uses EOVERFLOW
which is only defined in POSIX and not in C standard, but we're trying to avoid including POSIX in baremetal environments. More generally, I don't think that functions defined by the C standard should have unconditional dependencies on POSIX.