From nobody Mon May 6 22:16:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528447661624587.5461469539625; Fri, 8 Jun 2018 01:47:41 -0700 (PDT) Received: from localhost ([::1]:34050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRD3X-0005nz-RD for importer@patchew.org; Fri, 08 Jun 2018 04:47:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRCvb-0008JB-FP for qemu-devel@nongnu.org; Fri, 08 Jun 2018 04:39:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRCvY-0001fO-A8 for qemu-devel@nongnu.org; Fri, 08 Jun 2018 04:39:23 -0400 Received: from 5.mo179.mail-out.ovh.net ([46.105.43.140]:51830) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRCvY-0001ev-2n for qemu-devel@nongnu.org; Fri, 08 Jun 2018 04:39:20 -0400 Received: from player799.ha.ovh.net (unknown [10.109.122.15]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 41886CF2C5 for ; Fri, 8 Jun 2018 10:39:18 +0200 (CEST) Received: from bahia.lan (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player799.ha.ovh.net (Postfix) with ESMTPA id 7B256520099; Fri, 8 Jun 2018 10:39:15 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Fri, 08 Jun 2018 10:39:09 +0200 Message-ID: <152844714981.11789.3657734445739553287.stgit@bahia.lan> User-Agent: StGit/0.17.1-46-g6855-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 4662632990658632000 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrjeelgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.43.140 Subject: [Qemu-devel] [PATCH] typedefs: add QJSON X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Since commit 83ee768d6247b, we now have two places that define the QJSON type: $ git grep 'typedef struct QJSON QJSON' include/migration/vmstate.h:typedef struct QJSON QJSON; migration/qjson.h:typedef struct QJSON QJSON; This breaks docker-test-build@centos6: In file included from /tmp/qemu-test/src/migration/savevm.c:59: /tmp/qemu-test/src/migration/qjson.h:16: error: redefinition of typedef 'QJSON' /tmp/qemu-test/src/include/migration/vmstate.h:30: note: previous declaration of 'QJSON' was here make: *** [migration/savevm.o] Error 1 This happens because CentOS 6 has an old GCC 4.4.7. Even if redefining a typedef with the same type is permitted since GCC 4.6, unless -pedantic is passed, we don't really need to do that on purpose. Let's have a single definition in instead. Signed-off-by: Greg Kurz Reviewed-by: Dr. David Alan Gilbert --- include/migration/vmstate.h | 2 -- include/qemu/typedefs.h | 1 + migration/qjson.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 3747110f951a..42b946ce902c 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -27,8 +27,6 @@ #ifndef QEMU_VMSTATE_H #define QEMU_VMSTATE_H =20 -typedef struct QJSON QJSON; - typedef struct VMStateInfo VMStateInfo; typedef struct VMStateDescription VMStateDescription; typedef struct VMStateField VMStateField; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 325c72de3313..3ec0e13a967f 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -97,6 +97,7 @@ typedef struct QEMUTimer QEMUTimer; typedef struct QEMUTimerListGroup QEMUTimerListGroup; typedef struct QBool QBool; typedef struct QDict QDict; +typedef struct QJSON QJSON; typedef struct QList QList; typedef struct QNull QNull; typedef struct QNum QNum; diff --git a/migration/qjson.h b/migration/qjson.h index 2978b5f37121..41664f2d71b5 100644 --- a/migration/qjson.h +++ b/migration/qjson.h @@ -13,8 +13,6 @@ #ifndef QEMU_QJSON_H #define QEMU_QJSON_H =20 -typedef struct QJSON QJSON; - QJSON *qjson_new(void); void qjson_destroy(QJSON *json); void json_prop_str(QJSON *json, const char *name, const char *str);