blogRevision of Eiffel and the Y2K38 bug? from Fri, 04/24/2009 - 00:09

The revisions let you track differences between multiple versions of a post.

manus_eiffel's picture

Have you heard about the Y2K38 bug? If not, you should read the wikipedia entry about it. Is Eiffel immune of that problem? It depends on the platform and the C compiler you are using. The main two issues with time in the Eiffel libraries are:

  • The time stamp for files available through the FILE class.
  • The EiffelTime library queries to get the current time (e.g. {DATE}.make_now).

For the time stamp, regardless of your C compiler or platform, the FILE class will truncate the value since it is returning an INTEGER_32. So there is some work to be done there to get the INTEGER_64 value that most file system reports.

For the EiffelTime library, it is more complicated. For sure, if you are using a 64-bit platform you are immune since the C layer we use to query the time is always 64-bit. On 32-bit platform the story is a little bit more complicated. For example, on Windows, if you use an older version than Visual Studio 2005, then your code won't work, but if you use VS 2005 or above then it should work because the C compiler uses a 64-bit representation even on 32-bit platform. For 32-bit unices, it seems that you are out of luck as far as I can see