develooper Front page | perl.perl5.porters | Postings from May 2016

[perl #128167] Issues with the embedded y2038 library

Thread Next
R . Diez
May 17, 2016 13:46
[perl #128167] Issues with the embedded y2038 library
Message ID:
# New Ticket Created by  R. Diez 
# Please include the string:  [perl #128167]
# in the subject line of all future correspondence about this issue. 
# <URL: >

The Perl interpreter embeds a copy of Schwern's y2038 library, see file time64.c here:

I reported a few issues with this library, see this pull request of mine:

  "Amendments to y2038"

However, Schwern is not responding anymore.

>From that pull request, 2 particular issues stand out:

Issue 1) Array indexing with the result of a boolean C comparison.

This is dangerous because (as far as I know) the C standard does not guarantee that the inteeger result of a comparison always 0 or 1 is.

In this particular case, simplified:

  #define IS_LEAP(n)      (blah_blah != 0)

  days += length_of_year[IS_LEAP(year)];

Issue 2) One of the date unit test cases fails.

This makes me worry that the date/time calculations may fail at some point in time in the future.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About