Received: from eggs.gnu.org ([2001:4830:134:3::10]:54866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcBdx-0005dV-AO for qemu-devel@nongnu.org; Tue, 23 Aug 2016 09:21:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcBdr-0004VO-Qi for qemu-devel@nongnu.org; Tue, 23 Aug 2016 09:21:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32798 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcBdr-0004VI-Kg for qemu-devel@nongnu.org; Tue, 23 Aug 2016 09:21:23 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7NDKUrT112420 for ; Tue, 23 Aug 2016 09:21:23 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2502yqhy0m-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 Aug 2016 09:21:22 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Aug 2016 14:21:21 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 372E82190046 for ; Tue, 23 Aug 2016 14:20:42 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7NDLIXs6553994 for ; Tue, 23 Aug 2016 13:21:18 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7NDLIH8031232 for ; Tue, 23 Aug 2016 07:21:18 -0600 From: Sascha Silbe In-Reply-To: References: <1471545963-11720-1-git-send-email-silbe@linux.vnet.ibm.com> <1471545963-11720-2-git-send-email-silbe@linux.vnet.ibm.com> Date: Tue, 23 Aug 2016 15:21:17 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: <871t1fliya.fsf@oc4731375738.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 1/2] glib: add compatibility implementation for g_dir_make_tmp() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Alex =?utf-8?Q?Benn=C3=A9e?= , QEMU Developers , Markus Armbruster Dear Peter, Peter Maydell writes: [...] >> +#if !GLIB_CHECK_VERSION(2, 30, 0) >> +/* Not a 100% compatible implementation, but good enough for most >> + * cases. Placeholders are only supported at the end of the >> + * template. */ >> +static inline gchar *qemu_g_dir_make_tmp(gchar const *tmpl, GError **er= ror) >> +{ >> + gchar const *template =3D tmpl ? tmpl : ".XXXXXX"; > > This doesn't build: > In file included from /Users/pm215/src/qemu-for-merges/disas/arm-a64.cc:2= 1: > In file included from /Users/pm215/src/qemu-for-merges/include/qemu/osdep= .h:107: > /Users/pm215/src/qemu-for-merges/include/glib-compat.h:57:18: error: > expected unqualified-id > gchar const *template =3D tmpl ? tmpl : ".XXXXXX"; > ^ > /Users/pm215/src/qemu-for-merges/include/glib-compat.h:58:53: error: > expected expression > gchar *path =3D g_build_filename(g_get_tmp_dir(), template, NULL); > ^ > > because this header is included from some C++ files, where > "template" is a reserved word. I've fixed this by squashing > in the following change: Curious, didn't hit this on my laptop (Ubuntu 14.04, x86_64) and neither in the centos6 docker image. At least on my laptop arm-a64.cc gets compiled and -Werror is enabled, too. Does this happen with a particular tool chain only? clang perchance? FWIW, I would have expected the C language linkage specification (i.e. extern "C" {}) in disas/arm-a64.cc to take care of this kind of issue. However after scanning through C++11 it seems the linkage specification only affects external linkage names. Plus is doesn't seem keywords are valid identifiers even for external C language linkage names; there's only an exception for attributes, not for non-C++ language linkage. [From second mail] > Applied to master (with minor fixup to patch 1); thanks. Thanks! Sascha --=20 Softwareentwicklung Sascha Silbe, Niederhofenstra=C3=9Fe 5/1, 71229 Leonberg https://se-silbe.de/ USt-IdNr. DE281696641