[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] [5] Fix a few 64-bit issues
From: |
Peter Bex |
Subject: |
[Chicken-hackers] [PATCH] [5] Fix a few 64-bit issues |
Date: |
Tue, 6 Jun 2017 22:31:29 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hi all,
I noticed two problems after looking over the file-modification-time
patches I recently submitted. The first is that on 32-bit systems, the
mtime or atime that the user passes in would get truncated to 32 bits
on a 32-bit platform (and presumably also on a 64-bit LLP platform, ie
64-bit Windows) due to using C_int_to_num instead of C_int_to_num64.
The other problem is related; size_t is an unsigned type, not a signed
type, and it can be 64-bit even on 32-bit systems, so we should better
use C_int_to_num64 for that type as well.
Attached are patches for this.
Strictly speaking, I suppose we should really add a new C_num_to_size_t
or such, but if we do that, we will need to add it for every stupid
opaque type that C might offer. In practice, size_t is at most 64 bits
so let's just keep that assumption (for now?).
Cheers,
Peter
0001-Do-not-truncate-file-times-to-32-bits-on-32-bit-or-L.patch
Description: Text Data
0002-Fix-size_t-to-map-to-unsigned-64-bit-integers-add-si.patch
Description: Text Data
signature.asc
Description: Digital signature
- [Chicken-hackers] [PATCH] [5] Fix a few 64-bit issues,
Peter Bex <=