MMIX LOGO

MMIX Bug Report casting to time_t on 64-bit systems

Table of Content

Content

MMIXware Version

mmix-20131017

Bug Reported

Initial: 31/07/2017

Author

Shuo Chen

Description

On 64-bit platforms (and x32 ABI), time_t is a 64-bit integer. Casting a pointer to a 32-bit tetra to time_t* causes access violation and prints garbage. For example:
$ ./mmotype primes.mmo
File was created Fri Jun 24 03:54:43 1881
2000000000000000: 00020000
20000000000003e8: 00000000

Proposed Patch

@x
  if (listing)
    printf("File was created %s",asctime(localtime((time_t*)&tet)));
@y
  if (listing) {
    time_t t = tet;
    printf("File was created %s",asctime(localtime(&t)));
  }
@z

Discussion

This bug was fixed.

Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to email