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] Enum in cil



Thanks for your answer, it helps a lot.

Sorry for the mistake, I'm able now to find a TNamed in the ast for the 
enum side that refers to the __anonenum_side_1. That is what I was 
looking for.
Thanks.

Regards

David RIBEIRO CAMPELO



Anne Pacalet a ?crit :
> David RIBEIRO CAMPELO wrote :
>> For example :
>>
>> // Declaration of the enum:
>> typedef enum { left, middle, right,NB_side } side;
>> // Use of enum:
>> enum side t = left;
>
> I think the problem comes from a little error in your source code.
> By the way, you have an hint if you try to compile it..
> > gcc enum.c
> enum.c:4: error: variable 't' has initializer but incomplete type
>
> The reason is that :
>
> typedef enum { left, middle, right,NB_side } side;
>
> is a short cut for :
>
> enum an_enum_name { left, middle, right,NB_side };
> typedef enum an_enum_name side;
>
> Then, your have two names for the type :
> (enum an_enum_name) or side
> but not : enum side
> that you used in the declaration of the variable t.
>
> Hope this help.

-- 

 

	* David RIBEIRO CAMPELO*
*Ing?nieur - Atos Origin*
Telephone : 05 34 36 32 78
Mail : david.ribeirocampelo at atosorigin.com 
<mailto:david.ribeirocampelo at atosorigin.com>
6 Impasse Alice Guy
31024 Toulouse Cedex 03
www.atosorigin.fr <http://www.atosorigin.fr>

D?veloppement durable, anticipons pour notre avenir / Sustainability, 
advance our future
N'imprimez ce mail que si n?cessaire / please consider your 
environmental responsibility before printing this e-mail.
Ce message et les pi?ces jointes sont confidentiels et r?serv?s ? 
l'usage exclusif de ses destinataires. Il peut ?galement ?tre prot?g? 
par le secret professionnel. Si vous recevez ce message par erreur, 
merci d'en avertir imm?diatement l'exp?diteur et de le d?truire. 
L'int?grit? du message ne pouvant ?tre assur?e sur Internet, la 
responsabilit? du groupe Atos Origin ne pourra ?tre recherch?e quant au 
contenu de ce message. Bien que les meilleurs efforts soient faits pour 
maintenir cette transmission exempte de tout virus, l'exp?diteur ne 
donne aucune garantie ? cet ?gard et sa responsabilit? ne saurait ?tre 
recherch?e pour tout dommage r?sultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended 
solely for the addressee; it may also be privileged. If you receive this 
e-mail in error, please notify the sender immediately and destroy it. As 
its integrity cannot be secured on the Internet, the Atos Origin group 
liability cannot be triggered for the message content. Although the 
sender endeavours to maintain a computer virus-free network, the sender 
does not warrant that this transmission is virus-free and will not be 
liable for any damages resulting from any virus transmitted.

-------------- section suivante --------------
Une pi?ce jointe HTML a ?t? enlev?e...
URL: http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20090430/49f2fe3b/attachment-0001.htm 
-------------- section suivante --------------
Une pi?ce jointe non texte a ?t? nettoy?e...
Nom: ao_ioc_sign.gif
Type: image/gif
Taille: 4371 octets
Desc: non disponible
Url: http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20090430/49f2fe3b/attachment-0001.gif