[libc-commits] [libc] [libc] Make `off_t` 32-bit in arm targets (PR #231962)
Pavel Labath via libc-commits
libc-commits at lists.llvm.org
Thu Oct 15 05:22:23 PDT 2026
labath wrote:
Can you elaborate on the use case? E.g. are you just trying to fix the compiler errors, or do you actually want to have a 32-bit off_t type? Is it linux or bare metal?
I am asking this because we already sort of require:
https://github.com/llvm/llvm-project/blob/daf1383673177089c83bb19cb5fb77dfb29c3fb6/libc/docs/dev/date_and_time.md?plain=1#L30
a 64-bit time_t and there is no existing configuration which has a 32-bit off_t and 64-bit time_t (glibc's `_TIME_BITS=64` requires `_FILE_OFFSET_BITS=64`). Defining it as 32-bit (in full build mode) would mean we're the only ones who provide that configuration, and I'm not sure we want to do that, as 32-bit is really not enough for current applications.
Supporting 32-bit off_t in overlay mode makes more sense, but we'd have to figure out what to do about the time functions -- maybe just disable them in overlay mode.
At of course, all of that only makes sense for hosted linux environments. For bare metal, I can see a case for using (much) smaller offset types.
That's why I'm asking about the use case, because if the only goal is to fix shortening warnings, then I think the best solution is to fix the code to handle that properly...
https://github.com/llvm/llvm-project/pull/231962
More information about the libc-commits
mailing list