TrustInSoft / tis-interpreter

An interpreter for finding subtle bugs in programs written in standard C
565 stars 28 forks source link

gmtime #110

Closed kroeckx closed 8 years ago

kroeckx commented 8 years ago

common_helpers/common_time.c currently contains:

struct tm *gmtime(const time_t *timer)
{
    long l = 1441113529L;

    __secs_to_tm(l, &__fc_time_tm);

    Frama_C_show_each_gmtime(&__fc_time_tm);

    __fc_time_tm.tm_isdst = 0;

    return &__fc_time_tm;
}

This has 2 effects:

I don't see a reason why it should use this fixed value. I'm actually reading this time_t from a file so I expect gmtime() to convert for that time and might end up with a wrong result.

pascal-cuoq commented 8 years ago

You are completely right: these stub functions had been written a long time ago and were just good enough for one case study in which gmtime was only applied to the result of time().

Both problems should be fixed in the latest commit.