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] requires on arrays and strct
- Subject: [Frama-c-discuss] requires on arrays and strct
- From: virgile.prevosto at cea.fr (Virgile Prevosto)
- Date: Fri, 25 Sep 2009 14:48:00 +0200
- In-reply-to: <7ce13c50909250515q5c87ce3bk8480513f423f0c82@mail.gmail.com>
- References: <4ABB9FBE.1020603@gmail.com> <4ABC7ABB.8070001@cea.fr> <7ce13c50909250515q5c87ce3bk8480513f423f0c82@mail.gmail.com>
Hello, Le ven. 25 sept. 2009 14:15:03 CEST, Jean Couron <johcrown at gmail.com> a ?crit : > hello, > code in e.c is somethng like > typedef struct { int a; } A; > typedef struct { A * c[10]; } B; > typedef struct { B * c[10]; } C; > C v; > /* one of the 3 contracts below (wth MAXLEN==10)*/ > void foo(void); > > 3rd attempt below isnt an excepton: shouldit be also recorded as bug in bts? > > > > /*@ requires \valid((v.c+(0 .. MAXLEN-1))->c+(0 .. MAXLEN-1)); */ > > > frama-c -main f e.c -jessie > > > e.c:8:[kernel] user error: Error during annotations analysis: expected a > > > struct with field c This message is not a bug: the annotation is not correctly typed: v.c+(0..MAXLEN-1) represents a set of pointers to the elements of the array v.c, i.e. a set of pointers to pointers to B. Your first annotation asserts the validity of the pointers to A structures, while your second one says that each cell of the c array in the B structures is valid (which is pretty much the same as \valid((v.c[0..MAXLEN-1])->c) with your typedefs). They are correctly typechecked, but the jessie plug-in does not know how to handle them. -- E tutto per oggi, a la prossima volta. Virgile
- References:
- [Frama-c-discuss] requires on arrays and strct
- From: johcrown at gmail.com (johcrown)
- [Frama-c-discuss] requires on arrays and strct
- From: Julien.Signoles at cea.fr (Julien Signoles)
- [Frama-c-discuss] requires on arrays and strct
- From: johcrown at gmail.com (Jean Couron)
- [Frama-c-discuss] requires on arrays and strct
- Prev by Date: [Frama-c-discuss] requires on arrays and strct
- Next by Date: [Frama-c-discuss] why eclipse plugin
- Previous by thread: [Frama-c-discuss] requires on arrays and strct
- Next by thread: [Frama-c-discuss] Problem between Project change and modifying Ast information through visitors
- Index(es):