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
- Subject: [Frama-c-discuss] Enum in cil
- From: anne.pacalet at sophia.inria.fr (Anne Pacalet)
- Date: Thu, 30 Apr 2009 12:52:09 +0200
- In-reply-to: <49F97D77.20306@atosorigin.com>
- References: <49F97D77.20306@atosorigin.com>
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. -- Anne Pacalet - INRIA - 2004, route des Lucioles BP.93 F-06902 Sophia Antipolis Cedex. Tel : +33 (0) 4 9715 5345
- Follow-Ups:
- [Frama-c-discuss] Enum in cil
- From: david.ribeirocampelo at atosorigin.com (David RIBEIRO CAMPELO)
- [Frama-c-discuss] Enum in cil
- References:
- [Frama-c-discuss] Enum in cil
- From: david.ribeirocampelo at atosorigin.com (David RIBEIRO CAMPELO)
- [Frama-c-discuss] Enum in cil
- Prev by Date: [Frama-c-discuss] Enum in cil
- Next by Date: [Frama-c-discuss] Enum in cil
- Previous by thread: [Frama-c-discuss] Enum in cil
- Next by thread: [Frama-c-discuss] Enum in cil
- Index(es):