X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=2020-frama-c%2F5400-timeval.html;fp=2020-frama-c%2F5400-timeval.html;h=296d28135302fddba596d550b37f9dfbf9989ded;hb=b418766b4d897080ff67a6bd3bb558b14ec985d4;hp=0000000000000000000000000000000000000000;hpb=062da27127bc876eaeb4c728ed50bf744a3bcaa7;p=libguestfs-talks.git diff --git a/2020-frama-c/5400-timeval.html b/2020-frama-c/5400-timeval.html new file mode 100644 index 0000000..296d281 --- /dev/null +++ b/2020-frama-c/5400-timeval.html @@ -0,0 +1,30 @@ + + + + +
+ /*@ + requires \valid_read (x) && \valid_read (y); + requires valid_timeval (*x) && valid_timeval (*y); + requires \valid (r); + assigns *r; + behavior success: + ensures \result == 0; + ensures \let diff = tv_to_microseconds (*y) - tv_to_microseconds (*x); + INT64_MIN <= diff <= INT64_MAX && + *r == diff; + behavior failure: + ensures \result == -1; + ensures *r == 0; + ensures \let diff = tv_to_microseconds (*y) - tv_to_microseconds (*x); + !(INT64_MIN <= diff <= INT64_MAX); + complete behaviors; + disjoint behaviors; + */ + static inline int + tvdiff_usec (const struct timeval *x, const struct timeval *y, + int64_t *r) + ... +