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] Annotation pre-processing
- Subject: [Frama-c-discuss] Annotation pre-processing
- From: virgile.prevosto at m4x.org (Virgile Prevosto)
- Date: Fri, 26 Apr 2013 11:44:11 +0200
- In-reply-to: <OF48721396.DA3A35F6-ONC1257B59.002B9D51-C1257B59.0033F765@dga.defense.gouv.fr>
- References: <OF48721396.DA3A35F6-ONC1257B59.002B9D51-C1257B59.0033F765@dga.defense.gouv.fr>
Hello, 2013/4/26 <benoit.gerard at dga.defense.gouv.fr>: > First thanks to the community for the fast answering (and the new version). > > I may have missed something concerning pre-processing of annotations and the > option -pp-annot but I would like to be able to write something of the form > > #define SIZE 32 > //@ requires \valid(tab+(0..SIZE-1)); > void f( int *tab ); > > When launching Frama-C it induces an error (unbounded variable SIZE in > annotation). > I assume this is linked to the fact that SIZE is a parameter of the > predicate. > Is this a bug or a known limitation of the -pp-annot option? > This is a known limitation of C preprocessor. 0..SIZE is in fact a preprocessing number according to section 6.4.8 of C99 standard[1], i.e. a single pre-processing token. SIZE is thus not seen as a macro identifier. To overcome that, you can simply put a space between .. and SIZE (and/or 0). Best regards, -- E tutto per oggi, a la prossima volta Virgile [1] The rationale behind this still escapes me.
- References:
- [Frama-c-discuss] Annotation pre-processing
- From: benoit.gerard at dga.defense.gouv.fr (benoit.gerard at dga.defense.gouv.fr)
- [Frama-c-discuss] Annotation pre-processing
- Prev by Date: [Frama-c-discuss] Annotation pre-processing
- Next by Date: [Frama-c-discuss] verifying overflow in x++
- Previous by thread: [Frama-c-discuss] Annotation pre-processing
- Next by thread: [Frama-c-discuss] verifying overflow in x++
- Index(es):