From: "Jan Beulich" Subject: Re: stubdom vtpm build failure in staging Date: Fri, 30 Jan 2015 11:03:00 +0000 Message-ID: <54CB72F4020000780005B372@mail.emea.novell.com> References: <20150128150850.GA4285@aepfle.de> <1422458693.5187.19.camel@citrix.com> <945CA011AD5F084CBEA3E851C0AB28890E87F6C4@SHSMSX101.ccr.corp.intel.com> <20150129082706.GB1410@aepfle.de> <945CA011AD5F084CBEA3E851C0AB28890E87F775@SHSMSX101.ccr.corp.intel.com> <20150129093649.GA20318@aepfle.de> <20150129102736.GA1106@aepfle.de> <1422528392.30641.24.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1422528392.30641.24.camel@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Olaf Hering , Ian Jackson , Quan Xu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 29.01.15 at 11:46, wrote: > On Thu, 2015-01-29 at 11:27 +0100, Olaf Hering wrote: >> On Thu, Jan 29, Olaf Hering wrote: >> >> > Looks like old gcc can not handle two typedefs? >> >> Yes, this fails already: >> >> typedef unsigned char BYTE; >> typedef unsigned char BYTE; >> void f(int *v) { *v *= *v; } >> >> t.c:2:23: error: redefinition of typedef 'BYTE' >> t.c:1:23: note: previous declaration of 'BYTE' was here > > This compiles for me on Debian with gcc 4.7.2-5. > > I'm honestly not sure what the C standard says about duplicate but > identical typedefs -- Ian? I'm not Ian, but anyway: Under "Declarations", the standard says "If an identifier has no linkage, there shall be no more than one declaration of the identifier (in a declarator or type specifier) with the same scope and in the same name space, except for tags as specified in ..." Clearly typedef-s have no linkage, so it's at best a courtesy of some compiler versions to not choke on redundant typedef-s. And with -Wpedantic even gcc 4.9.2 issues a warning. Jan