This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/30015] Intrinsic date_and_time can go back in time



------- Comment #2 from burnus at gcc dot gnu dot org  2006-11-29 18:25 -------
Accept. Thanks for the bugreport and the patch.

I actually wanted to write:

The proposed solution is to change
   lt = time()
   local_time = *localtime (&lt);
   UTC_time = *gmtime (&lt);
   [...]
   values[6] = local_time.tm_sec;
   [...]
   gettimeofday (...)
   values[7] = tp.tv_usec / 1000;
to
   lt = time
   [...]
     gettimeofday (...)
     lt = tp.tv_sec;
     values[7] = tp.tv_usec / 1000;
   [...]
   local_time = *localtime (&lt);
   UTC_time = *gmtime (&lt);
   [...]
   values[6] = local_time.tm_sec;


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
                   |dot org                     |org
           Severity|critical                    |major
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-11-29 14:12:28         |2006-11-29 18:25:01
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30015


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]