From patchwork Tue Apr 30 20:08:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10924151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27D6E14B6 for ; Tue, 30 Apr 2019 20:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11F6928D3F for ; Tue, 30 Apr 2019 20:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 033E428C16; Tue, 30 Apr 2019 20:12:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB65628C16 for ; Tue, 30 Apr 2019 20:12:50 +0000 (UTC) Received: from localhost ([127.0.0.1]:52767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ7S-0005Hm-3n for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Apr 2019 16:12:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ3m-0002LD-RG for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLZ3l-00070G-PL for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:02 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:40728) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLZ3j-0006x4-AQ; Tue, 30 Apr 2019 16:08:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1556654961; x=1588190961; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=3hk22IXiPanYCVCAORHPd9Ou1I5+RlgHyiylTOqL6Fc=; b=nihU214Da6cvVraf5J9g9WnsjeDekSNoRyaJcXnYqTammYCTQ9mkXwIS GG4oGhd7w3HgUXwgAzT9ATosbUaB0V+UWC9by3DHaBBuuKabruEUS7eHa xcMGJdjX8KIDwY0GimIfKFgMMdDkicwVOmlSGNuiG4T6nH2ofmjvcEzka /RzpMDroTXcD5up7a2neGHMRFL/cZCZyjXdBAKbtzUWkXc6ib49B40cFh CrwTJp2rpetv6mRdkMlqvK1ltHpC8fzRhRLC2SFuUr25bGVJk6aUsu/wj /KOtPQmBaCij9hM4SOWs0wnC+OO3Caz5rUVn8fPBi4OFXokh2LBkrNdZL Q==; X-IronPort-AV: E=Sophos;i="5.60,414,1549900800"; d="scan'208";a="206404325" Received: from mail-sn1nam04lp2059.outbound.protection.outlook.com (HELO NAM04-SN1-obe.outbound.protection.outlook.com) ([104.47.44.59]) by ob1.hgst.iphmx.com with ESMTP; 01 May 2019 04:09:19 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3hk22IXiPanYCVCAORHPd9Ou1I5+RlgHyiylTOqL6Fc=; b=j4lhoz2fhTC7xzgAlZw42uTrM1K8lQyUalbFDZqLelOVijileO2rwXgj7MsesLDzVgYYpLkB9bgHLtyPAYojOHPWkDiG4lK8rz6cv+Hp0KZfU2K9wX89WqW2pUBBwwjJkEqTTd5t0zSpQL0H3MIQRsHi9R5K0alUZx75YdBDofk= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5672.namprd04.prod.outlook.com (20.179.57.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Tue, 30 Apr 2019 20:08:56 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66%5]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 20:08:56 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v1 1/5] util/qemu-sockets: Fix GCC 9 build warnings Thread-Index: AQHU/5CKMl0GweNxUkGP2/9h0Xa6UA== Date: Tue, 30 Apr 2019 20:08:56 +0000 Message-ID: <81a342ee886cf0f63cdbfc8573b14dd2d41de42d.1556650594.git.alistair.francis@wdc.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR01CA0021.prod.exchangelabs.com (2603:10b6:a02:80::34) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.172] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6b89b123-5382-46d6-108b-08d6cda7aca4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB5672; x-ms-traffictypediagnostic: BYAPR04MB5672: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1303; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(346002)(396003)(366004)(376002)(39860400002)(189003)(199004)(99286004)(4326008)(50226002)(71190400001)(71200400001)(7736002)(305945005)(316002)(14444005)(256004)(44832011)(186003)(36756003)(8936002)(6436002)(54906003)(2501003)(11346002)(102836004)(2906002)(26005)(6486002)(446003)(486006)(476003)(2616005)(5660300002)(8676002)(25786009)(6116002)(81156014)(81166006)(72206003)(3846002)(86362001)(66066001)(478600001)(73956011)(6512007)(66556008)(118296001)(66446008)(14454004)(66476007)(66946007)(64756008)(68736007)(53936002)(76176011)(97736004)(52116002)(2351001)(386003)(6506007)(5640700003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5672; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2O42GKT+to90woIdiQOfhNgavJ++bevtANJIgysVRLEVri3fcJvkyQNQ8EVZVT/K5riPp9k09mcfXE+sD+c4EY5EbcQBhQkJXzI9bePbWYr0qXxq6giIorfol1I530EChBOCVWlJtYCWyYTugIX3XQ25VTcjyVBwDEXv0YHGfQcRy0aNfeh1cpqJIl+zg8qkhpjUs7j35ybyT6hAibMsG1HO6LnfdAcaMllPIUs0e0nkiM9FeVA3Ms4RsrrM18QybPM175zjvrv4ztwofG50RlOsnIINYOs2IP6ZdGegRN1AfJcwXlxweNOz9POZrMDig3SH+gMkz8C5nd7ERk7i2q+VpvzaGyiwOqyFHPwpd7JYVp09bU0jnDuM3TTMidyAWwwV7opieGbAX2IHy3PR+1QvHUJB4Mj9QpPMM3H08dQ= Content-ID: <488EE58CF61ABB40A8A18DC96C8835D1@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b89b123-5382-46d6-108b-08d6cda7aca4 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 20:08:56.2261 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5672 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 68.232.143.124 Subject: [Qemu-devel] [PATCH v1 1/5] util/qemu-sockets: Fix GCC 9 build warnings 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: "qemu-trivial@nongnu.org" , "riku.voipio@iki.fi" , "laurent@vivier.eu" , Alistair Francis , "kraxel@redhat.com" , "alistair23@gmail.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fix this warning when building with GCC9 on Fedora 30: In function ‘strncpy’, inlined from ‘unix_connect_saddr.isra.0’ at util/qemu-sockets.c:925:5: /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘strncpy’, inlined from ‘unix_listen_saddr.isra.0’ at util/qemu-sockets.c:880:5: Signed-off-by: Alistair Francis --- util/qemu-sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 9705051690..4322652428 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -877,7 +877,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, memset(&un, 0, sizeof(un)); un.sun_family = AF_UNIX; - strncpy(un.sun_path, path, sizeof(un.sun_path)); + strncpy(un.sun_path, path, sizeof(un.sun_path) - 1); if (bind(sock, (struct sockaddr*) &un, sizeof(un)) < 0) { error_setg_errno(errp, errno, "Failed to bind socket to %s", path); @@ -922,7 +922,7 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp) memset(&un, 0, sizeof(un)); un.sun_family = AF_UNIX; - strncpy(un.sun_path, saddr->path, sizeof(un.sun_path)); + strncpy(un.sun_path, saddr->path, sizeof(un.sun_path) - 1); /* connect to peer */ do { From patchwork Tue Apr 30 20:09:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10924153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB8591398 for ; Tue, 30 Apr 2019 20:14:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94FFA289CB for ; Tue, 30 Apr 2019 20:14:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8569A28A05; Tue, 30 Apr 2019 20:14:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 182A6289CB for ; Tue, 30 Apr 2019 20:14:40 +0000 (UTC) Received: from localhost ([127.0.0.1]:52778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ9D-0006n7-BF for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Apr 2019 16:14:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ3x-0002PX-6i for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLZ3w-000755-84 for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:13 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:18442) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLZ3t-00073c-RO; Tue, 30 Apr 2019 16:09:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1556654950; x=1588190950; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=/kKF262cHiUAFnySiN2hIvVpZWdUfxx0a+lkNg1Ydy4=; b=XxZQHdWMsesrZEm7vmgoF/BkNJ9YHc2a7kgJeE6GTIh/Utt5/MXvtGxO AFdKzf7JmfrSPmMWav4CRrrwKNlG1BQypEZdPb7nQvwQubsmWK7uzB3v7 Bag+W16SBsN61VF1j2Ssuy3K2mnqM2r1CjiK+Eg0xlqXhO6x3L52unx/D B9hh559nXUyLqDpkWAbUrz130l7ulin6ytkDAB96NZisjTC/oyr/oPJC0 jILIZXHFIVFZtkouZQOseYarZVmZ4JxQUcwJ0xgywn0UACmy/P3IT2dpt N+ZdaYgZSITb9WMv9HFo5Ggbc+RrP2sfXmE2Se4MeAfVrjfiZ+696eZQD w==; X-IronPort-AV: E=Sophos;i="5.60,414,1549900800"; d="scan'208";a="107206319" Received: from mail-bn3nam01lp2055.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.55]) by ob1.hgst.iphmx.com with ESMTP; 01 May 2019 04:09:07 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/kKF262cHiUAFnySiN2hIvVpZWdUfxx0a+lkNg1Ydy4=; b=fAjsez1mFx6Mws1CD7/zusgfp5mMuaAQLhBGenX259PbBKr11b9iEPBrsaAPwr4nnNxizYYiODh2q3zNewWgipbwmZBJ78G6GEppP7j9I5A+E2lMyXqxauVAeXF8xFldvyJYoY7dmJ6/35/5Km8qU5QhuXYuJXXr/+c+LhsrnF0= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5672.namprd04.prod.outlook.com (20.179.57.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Tue, 30 Apr 2019 20:09:05 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66%5]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 20:09:05 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v1 2/5] hw/usb/hcd-xhci: Fix GCC 9 build warning Thread-Index: AQHU/5CPjvr6m7B7LkiAX4S+EF98OA== Date: Tue, 30 Apr 2019 20:09:05 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BY5PR13CA0009.namprd13.prod.outlook.com (2603:10b6:a03:180::22) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8d5c0873-49da-4d37-f162-08d6cda7b233 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB5672; x-ms-traffictypediagnostic: BYAPR04MB5672: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1332; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(346002)(396003)(366004)(376002)(39860400002)(189003)(199004)(99286004)(4326008)(50226002)(71190400001)(71200400001)(7736002)(305945005)(316002)(14444005)(256004)(44832011)(186003)(36756003)(8936002)(6436002)(54906003)(2501003)(11346002)(102836004)(2906002)(26005)(6486002)(446003)(486006)(476003)(2616005)(5660300002)(8676002)(25786009)(6116002)(81156014)(81166006)(72206003)(3846002)(86362001)(66066001)(478600001)(73956011)(6512007)(66556008)(118296001)(66446008)(14454004)(66476007)(66946007)(64756008)(68736007)(53936002)(76176011)(97736004)(52116002)(2351001)(386003)(6506007)(5640700003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5672; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9fl8vOi3rFg1n+IfRoMMMGK4K0SkmYyoS9xHZvb5Zwq+JMKMZZ+RtUIkK55nfRs2JeOAwwA5gFFJaxxqmKL0pt2iYZ4XnzgR+th4SALReX5bpnE1sMQ5WFKA0V8kw9rQBDBhHqsAO64QDFloMgzPyoDXOKJQMI9vlIBzWLIRSmqmWCB4I635IvlSAmNqq2arx/FLWnah3fdehriWU4aVW6o9PSw/OraTothKh0RdmkVSye3WVaN690mDG2bIxZ1uR6G5T4v1p3l/cKBXAod6Kr9ClCT+BmG79+uQliqfc1uwz2x5ADQB9HbfeZWBh1S6MwYsQ2a0rQqe1IxKt3QmJFQ6P7xkG0QICDkrbwC6fDRc9gGiJOFgFiNVdr+v7miEZmsdom5UUNh+xGrm8pcRkYJ60AXEfVp/Mqx/fgLNRJc= Content-ID: <033AC921E2AC5B47AF4E8024FB3CE262@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d5c0873-49da-4d37-f162-08d6cda7b233 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 20:09:05.5517 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5672 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.154.42 Subject: [Qemu-devel] [PATCH v1 2/5] hw/usb/hcd-xhci: Fix GCC 9 build warning 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: "qemu-trivial@nongnu.org" , "riku.voipio@iki.fi" , "laurent@vivier.eu" , Alistair Francis , "kraxel@redhat.com" , "alistair23@gmail.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fix this build warning with GCC 9 on Fedora 30: hw/usb/hcd-xhci.c:3339:66: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 5 [-Werror=format-truncation=] 3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1); | ^~ hw/usb/hcd-xhci.c:3339:54: note: directive argument in the range [1, 2147483647] 3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1); | ^~~~~~~~~~~~~~~ In file included from /usr/include/stdio.h:867, from /home/alistair/qemu/include/qemu/osdep.h:99, from hw/usb/hcd-xhci.c:21: /usr/include/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 13 and 22 bytes into a destination of size 16 67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | __bos (__s), __fmt, __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alistair Francis --- hw/usb/hcd-xhci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index 240caa4e51..9e4988abb6 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -133,7 +133,7 @@ typedef struct XHCIPort { uint32_t portnr; USBPort *uport; uint32_t speedmask; - char name[16]; + char name[24]; MemoryRegion mem; } XHCIPort; From patchwork Tue Apr 30 20:09:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10924145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CE9C14B6 for ; Tue, 30 Apr 2019 20:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F91C28D23 for ; Tue, 30 Apr 2019 20:10:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12CE728D70; Tue, 30 Apr 2019 20:10:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A380F28BBD for ; Tue, 30 Apr 2019 20:10:49 +0000 (UTC) Received: from localhost ([127.0.0.1]:52744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ5U-0003cJ-U2 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Apr 2019 16:10:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ44-0002Sc-PH for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLZ43-00077P-U1 for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:20 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:18463) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLZ41-00076X-Af; Tue, 30 Apr 2019 16:09:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1556654957; x=1588190957; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=t1F3oSyXeXmUcCQnM3yIqeG8yxJbnn+Grz5yfhWD3Dc=; b=VXzFQ++3zcZ6etb7//wxELhWJEHAnIDQQzD91VRTC9qqbowh0m43umcP SzvxxcfSzcOflHoS64CGG0So8EGG6N2t0VS2bfsOKjlhskh5auH+YdCnh spFcJ+8zDrjiSrhB0EkkEt7krXcuWhV/lL41O7caBKxUtT0Na3bjNlZIS YqNZq3ORdWhc5Zu0Fh9d9ccddC7Q4TYjs2SC0bUiysui29fRa1L176GBc y4zpQgv3nGgjxPFQUT/dH6C+OaNMRJt0ZNcz10F5DskgXVBeu9pk8TKOv XmhIxh0k7dIbHG74Fz10zJygVhRki6jc11oUxzXS2LqbZT4KgOue8nQZI A==; X-IronPort-AV: E=Sophos;i="5.60,414,1549900800"; d="scan'208";a="107206353" Received: from mail-bn3nam01lp2057.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.57]) by ob1.hgst.iphmx.com with ESMTP; 01 May 2019 04:09:15 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t1F3oSyXeXmUcCQnM3yIqeG8yxJbnn+Grz5yfhWD3Dc=; b=ejd42Y5z63YOzDingheOkwCZ9j92hLCvhbqd044oOfHn15IuVCQ0mJGScKJS3vsbp+/vsVl8bDN7oDgDDyneucE9RquwUJFOd88gIAANajuVW6tKKOYul7Wj+JGgzz3oOkipKI/8FPhjX23Oi0sRLZW54eJoij0/V/hcmHB+QhQ= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5672.namprd04.prod.outlook.com (20.179.57.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Tue, 30 Apr 2019 20:09:13 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66%5]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 20:09:13 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v1 3/5] hw/usb/dev-mtp: Fix GCC 9 build warning Thread-Index: AQHU/5CUO2QL1YlLekGmTofqK2bLDg== Date: Tue, 30 Apr 2019 20:09:13 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BY5PR13CA0009.namprd13.prod.outlook.com (2603:10b6:a03:180::22) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 613dc384-2da9-4176-5482-08d6cda7b71a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB5672; x-ms-traffictypediagnostic: BYAPR04MB5672: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:669; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(346002)(396003)(366004)(376002)(39860400002)(189003)(199004)(99286004)(4326008)(50226002)(71190400001)(71200400001)(7736002)(305945005)(316002)(14444005)(256004)(44832011)(186003)(36756003)(8936002)(6436002)(54906003)(2501003)(11346002)(102836004)(2906002)(26005)(6486002)(446003)(486006)(476003)(2616005)(5660300002)(8676002)(25786009)(6116002)(81156014)(81166006)(72206003)(3846002)(86362001)(66066001)(478600001)(73956011)(6512007)(66556008)(118296001)(66446008)(14454004)(66476007)(66946007)(64756008)(68736007)(53936002)(76176011)(97736004)(52116002)(2351001)(386003)(6506007)(5640700003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5672; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: AFKNN1oeiVDDxF4Ti3yYjNEdNTwFphD1GPn1tlbK/15ied6WPy5WIWgbcnMCzWuF03RXAQY04QDDtmBk9i7G8dy/RHKiaTCGZsWb51udVDWe6yyGmiOCNDKzzKYGyTrB6sCv5zd2JST7aFY3vDpbjCUtbceG0bcv6iEj17W6xNK4FLjsw5Y7ggAVxnSCDKIuI7oQyvTiVhRKnVRM9RbFWnH+kkJ5JzWGDLF4kOuPktGxyUOJCaPKCIuHiMPYyWRN11yxrcNmMlIVN3V9xYqXzUHdLkA9TP0iscEyj95e464nyaYgpBjSu9KDw4/mBAxp5fkv2RW70xPO69+zbjBohKTan4Qx/IH2CR9bHncbPNFKz0LGdL1NJ+yWc7NLPoL+BebCJkJsywRD4jnyreF3nVKevcKIjmEzDmpM+t819Zg= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 613dc384-2da9-4176-5482-08d6cda7b71a X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 20:09:13.7334 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5672 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.154.42 Subject: [Qemu-devel] [PATCH v1 3/5] hw/usb/dev-mtp: Fix GCC 9 build warning 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: "qemu-trivial@nongnu.org" , "riku.voipio@iki.fi" , "laurent@vivier.eu" , Alistair Francis , "kraxel@redhat.com" , "alistair23@gmail.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fix this warning with GCC 9 on Fedora 30: hw/usb/dev-mtp.c:1715:36: error: taking address of packed member of ‘struct ’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 1715 | dataset->filename); | ~~~~~~~^~~~~~~~~~ Signed-off-by: Alistair Francis --- hw/usb/dev-mtp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 99548b012d..6de85d99e6 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1711,9 +1711,22 @@ static void usb_mtp_write_metadata(MTPState *s, uint64_t dlen) assert(!s->write_pending); assert(p != NULL); +/* + * We are about to access a packed struct. We are confident that the pointer + * address won't be unalligned, so we ignore GCC warnings. + */ +#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif + filename = utf16_to_str(MIN(dataset->length, filename_chars), dataset->filename); +#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0) +#pragma GCC diagnostic pop +#endif + if (strchr(filename, '/')) { usb_mtp_queue_result(s, RES_PARAMETER_NOT_SUPPORTED, d->trans, 0, 0, 0, 0); From patchwork Tue Apr 30 20:09:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10924147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D035A14B6 for ; Tue, 30 Apr 2019 20:10:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1B4628BBC for ; Tue, 30 Apr 2019 20:10:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF82428D9A; Tue, 30 Apr 2019 20:10:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 523B528D94 for ; Tue, 30 Apr 2019 20:10:55 +0000 (UTC) Received: from localhost ([127.0.0.1]:52746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ5a-0003hU-EN for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Apr 2019 16:10:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ4C-0002WG-R7 for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLZ4B-00079e-Ta for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:28 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:40798) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLZ49-00078h-Nr; Tue, 30 Apr 2019 16:09:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1556654978; x=1588190978; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=UOZaOs/B8bleK1zjCn/Dhkn2yUro/O0bzQ/JhKde6Nc=; b=NdSaIIt8E0NAyomrw98DR96erhLSulyvGJfKgmJBmulyxvr1QNhlDB03 wOCdz0a40PvMGrvfj21zyqUcU/k8fQqLH8iOGbTTfTvOYNWr9Gc8mXart LN0CgOmBvQI8cVIxXOawNn87GwsXjEe4dryikigDUYa6yYcz2bQmrinhI pWsNKoDI4JDoFkh3DDSzeg7iuuinGhqFu7xBJjidaj2TJIGxGp6uuaFxW gnjGFYHJiPTPjXezY7GLZ+aQlm59Ly9xh7PZYZdkK+wkgywlacIPOutuI cH1LKb30RHEL6mRB5zV1l06GkHi31DCi3+rfd40ff9zhEbNBD3NVgPSEw g==; X-IronPort-AV: E=Sophos;i="5.60,414,1549900800"; d="scan'208";a="206404379" Received: from mail-sn1nam04lp2058.outbound.protection.outlook.com (HELO NAM04-SN1-obe.outbound.protection.outlook.com) ([104.47.44.58]) by ob1.hgst.iphmx.com with ESMTP; 01 May 2019 04:09:36 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UOZaOs/B8bleK1zjCn/Dhkn2yUro/O0bzQ/JhKde6Nc=; b=Oy1xA8Uzyhoyg1LZ64M5rEbPV6OycBnFEyvvri3EpXkrdacS6iFedaGCiIC31jmb2WbnRLrB5uAN8XibVfqGGfyl3dr6YwxhmYd2oj/zaqGxQa2aoECvKgVzOTgb1usoxdN8bsyQgVlgMGUOuqnfSMatdyVWUGKRN2GBIMwVGMY= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5672.namprd04.prod.outlook.com (20.179.57.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Tue, 30 Apr 2019 20:09:22 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66%5]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 20:09:22 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v1 4/5] linux-user/uname: Fix GCC 9 build warnings Thread-Index: AQHU/5CZaeZVOkuLrEKHRDQVZjm9tg== Date: Tue, 30 Apr 2019 20:09:21 +0000 Message-ID: <66295a3d9e21f52d777e6354d6c0f98b0bcb0c26.1556650594.git.alistair.francis@wdc.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR11CA0042.namprd11.prod.outlook.com (2603:10b6:a03:80::19) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ac681a59-713a-40d3-61c2-08d6cda7bc04 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB5672; x-ms-traffictypediagnostic: BYAPR04MB5672: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1148; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(346002)(396003)(366004)(376002)(39860400002)(189003)(199004)(99286004)(4326008)(50226002)(71190400001)(71200400001)(7736002)(305945005)(316002)(14444005)(256004)(44832011)(186003)(36756003)(8936002)(6436002)(54906003)(2501003)(11346002)(102836004)(2906002)(26005)(6486002)(446003)(486006)(476003)(2616005)(5660300002)(8676002)(25786009)(6116002)(81156014)(81166006)(72206003)(3846002)(86362001)(66066001)(478600001)(73956011)(6512007)(66556008)(118296001)(66446008)(14454004)(66476007)(66946007)(64756008)(68736007)(53936002)(76176011)(97736004)(52116002)(2351001)(386003)(6506007)(5640700003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5672; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: HBWWBcifMkYCSS7nLnyiCrPj+i1wQxI0D3ge5eR4ZguPdtHhH26FkeSpQn93n7/r5lA6q2+522z+vm494VbefE+CLOmu/2/ks+sek93tOuEwlfEFl+BUARWjupNnvWyBXlTp+b0EJOdevoOQpBUejvdSO4hYH+FdQeIuPb7uniHvrmz86WtfmIKfoR8ozwWIpqyo3kleLR2n6IxET957lC9jhCF2mZKAFpjWlFESz1h1dX3cyXYWMiZ1c0fjX6xpTEA73DNMcfJ1GRHYSEhvw79H+iI7uqEc2ow8ia0zXZn7GGVQfIKMDpHAKtCLchnAyqxqSOu9ZLEWJroq29dFv4LbkYgszsC+3jH84ToMcsq6WIXHRl1CXdlCnLBzXoAPGZkXmmyzn+eTPAUgMy5BbQgromRe1ziG94LlCOJ4zt0= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac681a59-713a-40d3-61c2-08d6cda7bc04 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 20:09:21.9982 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5672 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 68.232.143.124 Subject: [Qemu-devel] [PATCH v1 4/5] linux-user/uname: Fix GCC 9 build warnings 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: "qemu-trivial@nongnu.org" , "riku.voipio@iki.fi" , "laurent@vivier.eu" , Alistair Francis , "kraxel@redhat.com" , "alistair23@gmail.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fix this warning when building with GCC9 on Fedora 30: In function ‘strncpy’, inlined from ‘sys_uname’ at /home/alistair/qemu/linux-user/uname.c:94:3: /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output may be truncated copying 64 bytes from a string of length 64 [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alistair Francis --- linux-user/uname.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux-user/uname.c b/linux-user/uname.c index 313b79dbad..293b2238f2 100644 --- a/linux-user/uname.c +++ b/linux-user/uname.c @@ -90,6 +90,11 @@ int sys_uname(struct new_utsname *buf) * struct linux kernel uses). */ +#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif + memset(buf, 0, sizeof(*buf)); COPY_UTSNAME_FIELD(buf->sysname, uts_buf.sysname); COPY_UTSNAME_FIELD(buf->nodename, uts_buf.nodename); @@ -101,6 +106,9 @@ int sys_uname(struct new_utsname *buf) #endif return (0); +#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0) +#pragma GCC diagnostic pop +#endif #undef COPY_UTSNAME_FIELD } From patchwork Tue Apr 30 20:09:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10924149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1C7C1398 for ; Tue, 30 Apr 2019 20:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4AA928BC1 for ; Tue, 30 Apr 2019 20:11:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2E6528D6B; Tue, 30 Apr 2019 20:11:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ECCCC28BC1 for ; Tue, 30 Apr 2019 20:11:10 +0000 (UTC) Received: from localhost ([127.0.0.1]:52748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ5q-0003xF-4g for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Apr 2019 16:11:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLZ4N-0002fM-Jt for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLZ4L-0007DA-QG for qemu-devel@nongnu.org; Tue, 30 Apr 2019 16:09:39 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:40813) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLZ4H-0007BY-0U; Tue, 30 Apr 2019 16:09:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1556654989; x=1588190989; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=ZFAYi9wA7dxHwRHgzYhuh7lW918wFpfzj6T56gVNAOk=; b=pqT49xYCWuxY8BEi8x8GWcKLoiThU46iQIsDX4lmvGNTF0MyYDMBH7cq Vdv9B9jR+EqsGaq23fX0Z0uPwmriOeo7Ux3NEJWUPPK9RelgLsi3sh5es UFrLaBDpcjwGTRea/YvtDlHmkyfd45ZcVUg24DEyUvjMTzczvS0iDv1YC 4iuKUpUsWfL/UyDqfEY/UPnExLkRdRyc8Yk3UlF4s+5cu/bJ/QTpHvdwm B9c2Xly53/kBThpBEKrSKWftLbqyPRf/2YkBpHYJ0wBdzBxscUdvVBFHj zVznPyhgtgesJfdS2/rQhW9xUwYxocQ3WGm7W21xbZYSFzYTvkEKUag1u Q==; X-IronPort-AV: E=Sophos;i="5.60,414,1549900800"; d="scan'208";a="206404401" Received: from mail-sn1nam04lp2056.outbound.protection.outlook.com (HELO NAM04-SN1-obe.outbound.protection.outlook.com) ([104.47.44.56]) by ob1.hgst.iphmx.com with ESMTP; 01 May 2019 04:09:47 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZFAYi9wA7dxHwRHgzYhuh7lW918wFpfzj6T56gVNAOk=; b=nulhDyOQh+01s4tg+J+wpbVCutatKOLOQMu+B0aaTbe/cebCJ8bz7KlCY2dXdyNglunozNP1GJehTw2sm1nfurz6xeU+v5/i1X90JimaJ62g60nVbmpxvUQSwVjl9d1QOGNFbfO4rv6sskWvxb6kTjCONBxhiU39HgrKaSVrIak= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5672.namprd04.prod.outlook.com (20.179.57.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Tue, 30 Apr 2019 20:09:30 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66%5]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 20:09:30 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v1 5/5] linux-user/elfload: Fix GCC 9 build warnings Thread-Index: AQHU/5CeAn8+swhxLEm3vV4pJevVaQ== Date: Tue, 30 Apr 2019 20:09:29 +0000 Message-ID: <6bfa446eb7c351b5d867eb4158198231af724b11.1556650594.git.alistair.francis@wdc.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR11CA0054.namprd11.prod.outlook.com (2603:10b6:a03:80::31) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4f3c5bc3-6642-47b8-6d84-08d6cda7c0c6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB5672; x-ms-traffictypediagnostic: BYAPR04MB5672: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1443; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(346002)(396003)(366004)(376002)(39860400002)(189003)(199004)(99286004)(4326008)(50226002)(71190400001)(71200400001)(7736002)(305945005)(316002)(14444005)(256004)(44832011)(186003)(36756003)(8936002)(6436002)(54906003)(2501003)(11346002)(102836004)(2906002)(26005)(6486002)(446003)(486006)(476003)(2616005)(5660300002)(8676002)(25786009)(6116002)(81156014)(81166006)(72206003)(3846002)(86362001)(66066001)(478600001)(73956011)(6512007)(66556008)(118296001)(66446008)(14454004)(66476007)(66946007)(64756008)(68736007)(53936002)(76176011)(97736004)(52116002)(2351001)(386003)(6506007)(5640700003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5672; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 4EGSBdhNdC8V3EgM1aw954vW7034A09KhWsGsWVG48VO3IHEbINCXrOXF+kUNxDJDq3MNBTaq6C2LJ/11Ce73vhg8ycDCLB/8KeNFr9V12BJFWQeYNDprGm61MOZKExmR0DF7hmvMC4J9owsrbbOzJ8ffDj9VOdDiCoK0kJrGshV+oqZC0y0cKkI7eG2yyOOV9YvUGASDtmpUAGi3jfCMnczJZm3huayCAanHXCsHLd9GRvULcLrRUePhjQ+W5j94iyG/5KJuddem0fp2GQVLoRyoXH+8Ao7ged6xY10aKQJPSfEYplDQz0muJWP+ph0xOn1nj50sl+U2Jdj/Ghre/KrXZN0fkVo14y4/xPYe17WcIgYgwRwVsO3DiWmzHfo9pYr6r1QuzRyrTYYhsLOrLuCBm00RY4vHxTQteJdCrI= Content-ID: <6A83FF89C78ED949B2F2FF24B129CC78@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f3c5bc3-6642-47b8-6d84-08d6cda7c0c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 20:09:29.9587 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5672 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 68.232.143.124 Subject: [Qemu-devel] [PATCH v1 5/5] linux-user/elfload: Fix GCC 9 build warnings 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: "qemu-trivial@nongnu.org" , "riku.voipio@iki.fi" , "laurent@vivier.eu" , Alistair Francis , "kraxel@redhat.com" , "alistair23@gmail.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fix this warning when building with GCC9 on Fedora 30: In function ‘strncpy’, inlined from ‘fill_psinfo’ at /home/alistair/qemu/linux-user/elfload.c:3208:12, inlined from ‘fill_note_info’ at /home/alistair/qemu/linux-user/elfload.c:3390:5, inlined from ‘elf_core_dump’ at /home/alistair/qemu/linux-user/elfload.c:3539:9: /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alistair Francis --- linux-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index c1a26021f8..cbb7fc10fa 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3206,7 +3206,7 @@ static int fill_psinfo(struct target_elf_prpsinfo *psinfo, const TaskState *ts) * this field is not NUL-terminated. */ (void) strncpy(psinfo->pr_fname, base_filename, - sizeof(psinfo->pr_fname)); + sizeof(psinfo->pr_fname) - 1); g_free(base_filename); bswap_psinfo(psinfo); @@ -3389,7 +3389,7 @@ static int fill_note_info(struct elf_note_info *info, sizeof (*info->prstatus), info->prstatus); fill_psinfo(info->psinfo, ts); fill_note(&info->notes[1], "CORE", NT_PRPSINFO, - sizeof (*info->psinfo), info->psinfo); + sizeof(*info->psinfo) - 1, info->psinfo); fill_auxv_note(&info->notes[2], ts); info->numnote = 3;