Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
euantorano opened this issue Sep 2, 2019 · 0 comments · Fixed by #12137
Closed

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

euantorano opened this issue Sep 2, 2019 · 0 comments · Fixed by #12137

Comments

@euantorano
Copy link
Contributor

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.

euantorano added a commit to euantorano/Nim that referenced this issue Sep 5, 2019
euantorano added a commit to euantorano/Nim that referenced this issue Oct 10, 2019
Araq pushed a commit that referenced this issue Nov 11, 2019
* Fix #12135 and fix #12109 - fix OpenBSD type defs

* Fix Mode definition as in #12132
alehander92 pushed a commit to alehander92/Nim that referenced this issue Dec 2, 2019
* Fix nim-lang#12135 and fix nim-lang#12109 - fix OpenBSD type defs

* Fix Mode definition as in nim-lang#12132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants