[mercury-users] Converting time_t to int using common library?

Peter Schachte schachte at csse.unimelb.edu.au
Tue Feb 13 19:22:50 AEDT 2007

Julien Fischer wrote:
> On Tue, 13 Feb 2007 doug.auclair at logicaltypes.com wrote:
>> You know that it's an int, and so do I.
> I know nothing of the sort ;-)
> Mercury's time_t is implemented as C's time_t.  According to the C standard
> time_t and clock_t are "arithmetic types capable of representing times."
> There is no particular requirement for time_t to be a C int, let alone that
> it should correspond to a Mercury one.

But in this case, it really doesn't matter.  All Doug needs is some entropy; he
doesn't care about the actual value.  I think in this case, probably a C-style
cast is the right thing to do.  This is a very unusual situation.

Peter Schachte              Among the vanquished the poor people went
schachte at cs.mu.OZ.AU        hungry, among the victors the poor people went
www.cs.mu.oz.au/~schachte/  hungry.
Phone: +61 3 8344 1338          -- Bertold Brecht
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list