Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] [Jessie] Issue with behavior in contracts
- Subject: [Frama-c-discuss] [Jessie] Issue with behavior in contracts
- From: dmentre at linux-france.org (David MENTRE)
- Date: Thu, 5 Mar 2009 18:23:50 +0100
- In-reply-to: <3d13dcfc0903040554n5faf5f7evde83550ab20fb5db@mail.gmail.com>
- References: <3d13dcfc0903030830m26d0d328n1ac6057eed4a1ff8@mail.gmail.com> <49AE6A21.4070005@inria.fr> <3d13dcfc0903040554n5faf5f7evde83550ab20fb5db@mail.gmail.com>
Hello Claude, On Wed, Mar 4, 2009 at 14:54, David MENTRE <dmentre at linux-france.org> wrote: > On Wed, Mar 4, 2009 at 12:46, Claude March? <Claude.Marche at inria.fr> wrote: >> So, to specify read() I suggest : >> >> /*@ requires fd >= 0; >> ? ? requires count > 0; >> ? ? requires \valid((char*)buf+(0..count-1)); >> ? ? assigns global_error_number, ((char*)buf)[0..count-1]; >> ? ? ensures ... (see below) >> ? @*/ After re-reading the man of read(2), I followed your advice and used the much simpler contract: /*@ requires fd >= 0; requires count > 0 && count <= SSIZE_MAX; requires \valid((char*)buf+(0..count-1)); assigns global_error_number; assigns ((char*)buf)[0..count-1]; */ ssize_t read(int fd, void *buf, size_t count); It is astonishing how C stdlib functions are loosely specified. :-) Sincerely yours, david
- References:
- [Frama-c-discuss] [Jessie] Issue with behavior in contracts
- From: dmentre at linux-france.org (David MENTRE)
- [Frama-c-discuss] [Jessie] Issue with behavior in contracts
- From: Claude.Marche at inria.fr (Claude Marché)
- [Frama-c-discuss] [Jessie] Issue with behavior in contracts
- From: dmentre at linux-france.org (David MENTRE)
- [Frama-c-discuss] [Jessie] Issue with behavior in contracts
- Prev by Date: [Frama-c-discuss] Best approach when specifying regular C functions from stdlib?
- Next by Date: [Frama-c-discuss] an example involving floats
- Previous by thread: [Frama-c-discuss] [Jessie] Issue with behavior in contracts
- Next by thread: [Frama-c-discuss] [Jessie] Issue with offset in static strings
- Index(es):