posix_compat.h uses struct timeval which is defined in <sys/time.h>
but it doesn't include it. On most POSIX platforms like Linux or macOS,
that headers is transitively included by other headers like <sys/stat.h>,
but there are other platforms where this is not the case.
Details
Details
- Reviewers
ldionne Mordante philnik zibi - Group Reviewers
Restricted Project - Commits
- rG037952f6d4a5: [libcxx] Include <sys/time.h> in posix_compat.h
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
We noticed this in our downstream CI after D152377 landed where we started getting build errors like these:
In file included from /b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/filesystem/directory_entry.cpp:16: /b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/filesystem/time_utils.h:263:16: error: incomplete result type 'TimeVal' (aka 'std::filesystem::detail::(anonymous namespace)::timeval') in function definition 263 | inline TimeVal make_timeval(TimeSpec const& ts) { | ^