From nobody Thu Apr 25 19:50:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1667936174; cv=none; d=zohomail.com; s=zohoarc; b=LhkJQTqhM9Es7L4ANVdqoj2qi5xAM3/TSDWIri6sdTfEhhwNx1bh8VPk4lRAp+QZNMnC4BX+9r/LgXcsf1duFllkkuZRQtGqXSdqwb0UowJVoAnvdzl5/Go/LE8GzmhpegYPVoCbDRxnD16yuLba18yKYI8L8UMD2rdh8BWEOmg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667936174; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=jzJSziQ42pClnLjAcN+vkLZrE33RlzbKRPveYOFnUEQ=; b=Yckwyau5aQl84POy3GbAZCQUgq/Asrb0QzC9b0OnZSR832m44YbEytWFEz0aJyHERbeakiCWYNVIJAf4pKIeeKx3SLwrIKbuqiIGrBJoY4XPDiyspeQU34jfJDrhDXVBkgTRNjKZbx4h9919bywLyabmeeIgbMqXuMon9eD8RU8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1667936174217899.27488643737; Tue, 8 Nov 2022 11:36:14 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-372-xWtJgsXMPUiujAj65YXUEw-1; Tue, 08 Nov 2022 14:36:09 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7F6741C05ABC; Tue, 8 Nov 2022 19:36:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B909F2166B2C; Tue, 8 Nov 2022 19:36:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1CDE194658F; Tue, 8 Nov 2022 19:36:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CDA2F194658F for ; Tue, 8 Nov 2022 19:35:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1C1FA1410DDA; Tue, 8 Nov 2022 19:35:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14C9D140EBF3 for ; Tue, 8 Nov 2022 19:35:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EE98585A5B6 for ; Tue, 8 Nov 2022 19:35:55 +0000 (UTC) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-56-6IV9ZRxaNq6pWT4vVPKWuw-1; Tue, 08 Nov 2022 14:35:54 -0500 Received: by mail-ed1-f54.google.com with SMTP id a13so24138433edj.0 for ; Tue, 08 Nov 2022 11:35:53 -0800 (PST) Received: from tulp.dynamic.ziggo.nl (82-217-190-30.cable.dynamic.v4.ziggo.nl. [82.217.190.30]) by smtp.gmail.com with ESMTPSA id hp20-20020a1709073e1400b0078d3f96d293sm5035941ejc.30.2022.11.08.11.35.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 11:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667936173; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jzJSziQ42pClnLjAcN+vkLZrE33RlzbKRPveYOFnUEQ=; b=CKpwL1WN1lyaafh6Yldjlr6oeFowHKr5HlAumJ2MDUrWm5QdfaV7IbM/AMWE8PjjemUoqY k+AI6EpCbXuYtBYGIZPpNc7vmVMjLhPls7IBvuHf1Xfb2skPlBDVcwv1rKXSgoK25WbP0R eCAEXc3jkHQDU3OyO2HZXOO0rIL8xEo= X-MC-Unique: xWtJgsXMPUiujAj65YXUEw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 6IV9ZRxaNq6pWT4vVPKWuw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jzJSziQ42pClnLjAcN+vkLZrE33RlzbKRPveYOFnUEQ=; b=Ou3YsLHSYlgN6HnP+tO8nnE+AyMOPHVqRdHGKeIAsZi4AXWVagLdcaEQDGg1151+8Q /EkzSX7OaAj+rgXtOZSETFt6PMgd8gpUie1OFKCxIwAcPwg3Wj68vsaly7uKdgihIMjW VN3QNTuZwgfiLx6dinhGKia9NoRyGQ5LWF+UKK3fE1lFHF6mBNogjMIrxBW8O34q+qHs uHzM0eol0JTli2hNQwyqLbF04eI50lbYIIb/XaOK37eHWnLEWC6UZwQvc1JHzq6Rwups FrFGPMvEfQ/olTDurrGJK1g+L7Eb4K/iOUk+gyrGIxvbbecQKpVwJBr3/bvHcQ3GvWug YnMA== X-Gm-Message-State: ACrzQf2PuG/ba3yTC/R8AYLa5vro1hGNV/0P0K8EK1rlGzV892eFfJKg iFqbHyyR6G6UlucZFOBH8VRcXwGQX9k= X-Google-Smtp-Source: AMsMyM5CS1udG4w1XGPboCItf/Wo7NJY+0AFy54epF6jvMQlYoH1E31nbLTf+NUicRULZHIpCMomSg== X-Received: by 2002:a05:6402:3596:b0:462:6b69:873a with SMTP id y22-20020a056402359600b004626b69873amr57744027edc.374.1667936152585; Tue, 08 Nov 2022 11:35:52 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Subject: [PATCH] maint: fix "mixing declarations and code" errors Date: Tue, 8 Nov 2022 20:35:31 +0100 Message-Id: <20221108193531.15914-1-bogorodskiy@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roman Bogorodskiy Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667936176097100001 Content-Type: text/plain; charset="utf-8"; x-default="true" clang 14.0.5 complains: ../src/bhyve/bhyve_device.c:42:29: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement] virDomainPCIAddressSet *addrs =3D opaque; ^ 1 error generated. And a few similar errors in some other places, mainly bhyve related. Apply a trivial fix to resolve that. Signed-off-by: Roman Bogorodskiy Reviewed-by: Michal Privoznik --- src/bhyve/bhyve_device.c | 6 ++++-- tests/bhyvexml2argvmock.c | 4 ++-- tests/domaincapstest.c | 3 ++- tests/networkxml2conftest.c | 16 +++++++++------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index 5654028ca5..e4d14c4102 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -36,11 +36,13 @@ bhyveCollectPCIAddress(virDomainDef *def G_GNUC_UNUSED, virDomainDeviceInfo *info, void *opaque) { + virDomainPCIAddressSet *addrs =3D NULL; + virPCIDeviceAddress *addr =3D NULL; if (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) return 0; =20 - virDomainPCIAddressSet *addrs =3D opaque; - virPCIDeviceAddress *addr =3D &info->addr.pci; + addrs =3D opaque; + addr =3D &info->addr.pci; =20 if (addr->domain =3D=3D 0 && addr->bus =3D=3D 0 && addr->slot =3D=3D 0= ) { return 0; diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c index 9b77f97e5f..fe76564d51 100644 --- a/tests/bhyvexml2argvmock.c +++ b/tests/bhyvexml2argvmock.c @@ -25,10 +25,10 @@ init_syms(void) DIR * opendir(const char *path) { - init_syms(); - g_autofree char *path_override =3D NULL; =20 + init_syms(); + if (STREQ(path, "fakefirmwaredir")) { path_override =3D g_strdup(FAKEFIRMWAREDIR); } else if (STREQ(path, "fakefirmwareemptydir")) { diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index b4cb1894c2..b3cf4426f3 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -397,8 +397,9 @@ mymain(void) #define DO_TEST_BHYVE(Name, Emulator, BhyveCaps, Type) \ do { \ g_autofree char *name =3D NULL; \ + struct testData data; \ name =3D g_strdup_printf("bhyve_%s.x86_64", Name); \ - struct testData data =3D { \ + data =3D (struct testData) { \ .name =3D name, \ .emulator =3D Emulator, \ .arch =3D "x86_64", \ diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 726f073ddc..d18985e060 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -50,14 +50,16 @@ testCompareXMLToConfFiles(const char *inxml, const char= *outconf, =20 /* Any changes to this function ^^ should be reflected here too. */ #ifndef __linux__ - char * tmp; + { + char * tmp; =20 - if (!(tmp =3D virStringReplace(confactual, - "except-interface=3Dlo0\n", - "except-interface=3Dlo\n"))) - goto fail; - VIR_FREE(confactual); - confactual =3D g_steal_pointer(&tmp); + if (!(tmp =3D virStringReplace(confactual, + "except-interface=3Dlo0\n", + "except-interface=3Dlo\n"))) + goto fail; + VIR_FREE(confactual); + confactual =3D g_steal_pointer(&tmp); + } #endif =20 if (virTestCompareToFile(confactual, outconf) < 0) --=20 2.38.0