Skip to content

src/time/time_utils.h unconditionally uses EOVERFLOW #85556

@petrhosek

Description

@petrhosek

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.

CC @michaelrj-google

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions