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

emscripten time_t has wrong size #3306

Open
benjamin-sieffert opened this issue Jul 20, 2023 · 1 comment
Open

emscripten time_t has wrong size #3306

benjamin-sieffert opened this issue Jul 20, 2023 · 1 comment

Comments

@benjamin-sieffert
Copy link

benjamin-sieffert commented Jul 20, 2023

time_t is 64bit on emscripten since emscripten-core/emscripten#17401
Currently the undersized struct definition here truncates the last 4 bytes of the timespec, I believe, so that Instant::now() etc. end up having no sub-second resolution on wasm32-unknown-emscripten.

Filed these issues with more details before I landed here:
emscripten-core/emscripten#19872
rust-lang/rust#113852

It is curious to note that time_t was only 32-bit for a short while, starting with emscripten-core/emscripten#16966 (edit: according the comment in that PR, the size on wasm32 stayed the same at that point, so I presume it was indeed 64-bit for the first time from 17401)
although it has been 32-bit in this repo for 6 years. I am not seeing the same issue before 16966 that I am seeing after 17401, however. So there is probably another glitch or two that either masked the issue before 16966 or (in between 16966 and 17401) enabled the issue to surface as soon as the size became wrong again.

Cheers!

@kleisauke
Copy link
Contributor

I think PR #3569 would fix this.

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.

3 participants