[libc-commits] [libc] [libc] Change __llvm_libc_stdio_seek to match cookie_io_functions_t (PR #225632)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Thu Nov 5 11:05:50 PST 2026


================
@@ -27,12 +27,13 @@ LLVM_LIBC_FUNCTION(long, ftell, (::FILE * stream)) {
     libc_errno = EINVAL;
     return -1;
   }
-  off_t result = __llvm_libc_stdio_seek(stream, 0, SEEK_CUR);
+  off_t offset;
----------------
michaelrj-google wrote:

if `__llvm_libc_stdio_seek` is intended to match the fopencookie version, then `offset` is an in-out parameter and must be initialized here.
```suggestion
  off_t offset = 0;
```

https://github.com/llvm/llvm-project/pull/225632


More information about the libc-commits mailing list