From nobody Sun Feb 8 11:04:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547573714881839.1628355477567; Tue, 15 Jan 2019 09:35:14 -0800 (PST) Received: from localhost ([127.0.0.1]:57131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjScL-0003aX-47 for importer@patchew.org; Tue, 15 Jan 2019 12:35:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjSa3-000272-Dp for qemu-devel@nongnu.org; Tue, 15 Jan 2019 12:32:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjSa2-0007Rp-BF for qemu-devel@nongnu.org; Tue, 15 Jan 2019 12:32:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34754) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjSa2-0007RA-5z for qemu-devel@nongnu.org; Tue, 15 Jan 2019 12:32:50 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FABC86663 for ; Tue, 15 Jan 2019 17:32:48 +0000 (UTC) Received: from thuth.com (ovpn-116-182.ams2.redhat.com [10.36.116.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 665834142; Tue, 15 Jan 2019 17:32:44 +0000 (UTC) From: Thomas Huth To: Eduardo Otubo , qemu-devel@nongnu.org Date: Tue, 15 Jan 2019 18:32:42 +0100 Message-Id: <1547573562-32754-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 15 Jan 2019 17:32:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] seccomp: Work-around GCC 4.x bug in gnu99 mode 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: Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We'd like to compile QEMU with -std=3Dgnu99, but GCC 4.8 currently fails to compile qemu-seccomp.c in this mode: qemu-seccomp.c:45:1: error: initializer element is not constant }; ^ qemu-seccomp.c:45:1: error: (near initialization for =E2=80=98sched_setsche= duler_arg[0]=E2=80=99) This is due to a compiler bug which has just been fixed in GCC 5.0: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63567 Since we still want to support GCC 4.8 for a while and also want to use gnu99 mode, work-around the issue by expanding the macro manually. Signed-off-by: Thomas Huth Acked-by: Eduardo Otubo Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- qemu-seccomp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index 5c73e6a..36d5829 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -41,7 +41,8 @@ struct QemuSeccompSyscall { }; =20 const struct scmp_arg_cmp sched_setscheduler_arg[] =3D { - SCMP_A1(SCMP_CMP_NE, SCHED_IDLE) + /* was SCMP_A1(SCMP_CMP_NE, SCHED_IDLE), but expanded due to GCC 4.x b= ug */ + { .arg =3D 1, .op =3D SCMP_CMP_NE, .datum_a =3D SCHED_IDLE } }; =20 static const struct QemuSeccompSyscall blacklist[] =3D { --=20 1.8.3.1