Skip to content

posix.Time is defined as clong on OpenBSD when it should be a long long #12109

@euantorano

Description

@euantorano

On OpenBSD, posix.Time is defined as a clong (due to posix_other.nim), where OpenBSD defines it as a __int64_t which is long long on AMD64.

This results in errors like below:

/home/build/.cache/nim/tasync_cpp_d/stdlib_times.nim.cpp:1509:19: error: no matching function for call to 'localtime'
        struct tm* T2_ = localtime((&a));
                         ^~~~~~~~~
/usr/include/time.h:131:12: note: candidate function not viable: no known conversion from 'long *' to 'const time_t *' (aka 'const long long *') for 1st argument
struct tm *localtime(const time_t *);

Note that it looks like FreeBSD may also be the same under certain circumstances, though I'm not sure?

Possible Solution

A new posix_openbsd_amd64 module should be added to define time_t correctly, along with any other different values.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions