From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [BUG] xenctrl.h : error with xc_error_code declaration Date: Thu, 10 Sep 2015 15:59:03 +0300 Message-ID: <55F17E97.5010607@bitdefender.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?UTF-8?B?U8OpYmFzdGllbiBGcsOpbWFs?= , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 09/10/2015 03:52 PM, S=E9bastien Fr=E9mal wrote: > I just write to signal a bug and its solution. I installed the 14.04 LTS > ubuntu version and installed the xen version through synaptic. As I'm > developping modules for Xen I also installed the xen dev package. The > installed Xen version is 4.4.2. > = > I tried to compile one of my C files including xenctrl.h but I got the > following errors : > In file included from ../modules/gntring/libgntring4.c:12:0: > /usr/include/xenctrl.h:122:14: error: use of enum =91xc_error_code=92 > without previous declaration > typedef enum xc_error_code xc_error_code; > ^ > /usr/include/xenctrl.h:122:41: error: invalid type in declaration before > =91;=92 token > typedef enum xc_error_code xc_error_code; > ^ > /usr/include/xenctrl.h:1759:6: error: using typedef-name =91xc_error_code= =92 > after =91enum=92 > enum xc_error_code { > ^ > /usr/include/xenctrl.h:122:28: note: =91xc_error_code=92 has a previous > declaration here > typedef enum xc_error_code xc_error_code; > ^ > /usr/include/xenctrl.h:1770:8: error: using typedef-name =91xc_error_code= =92 > after =91enum=92 > enum xc_error_code code; > ^ > /usr/include/xenctrl.h:122:28: note: =91xc_error_code=92 has a previous > declaration here > typedef enum xc_error_code xc_error_code; > = > = > = > = > I looked at xenctrl.h and the typedef is put before the declaration of > the enum : > = > typedef enum xc_error_code xc_error_code; > = > ... > = > enum xc_error_code { > XC_ERROR_NONE =3D 0, > XC_INTERNAL_ERROR =3D 1, > XC_INVALID_KERNEL =3D 2, > XC_INVALID_PARAM =3D 3, > XC_OUT_OF_MEMORY =3D 4, > /* new codes need to be added to xc_error_level_to_desc too */ > }; > = > = > = > = > I swapped the two declarations and that works just fine : > = > enum xc_error_code { > XC_ERROR_NONE =3D 0, > XC_INTERNAL_ERROR =3D 1, > XC_INVALID_KERNEL =3D 2, > XC_INVALID_PARAM =3D 3, > XC_OUT_OF_MEMORY =3D 4, > /* new codes need to be added to xc_error_level_to_desc too */ > }; > = > typedef enum xc_error_code xc_error_code; That's already been fixed in 4.6: http://lists.xen.org/archives/html/xen-devel/2014-07/msg00423.html Cheers, Razvan