From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90B08A2EDB for ; Tue, 1 Oct 2019 19:15:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D81A44C3; Tue, 1 Oct 2019 19:15:51 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50084.outbound.protection.outlook.com [40.107.5.84]) by dpdk.org (Postfix) with ESMTP id 7E55B3423 for ; Tue, 1 Oct 2019 19:15:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KRIciZgqXRWl5q1hbj1ZMOsXyYKL7Jweo+7j7MfASBOUwJVfO7aRbSbwOLwpLOKa6Ecrdaf2CwiYA2ULkJmS3PcrEIAkz/THLUggKYqOrJJjQ8wYHaFnVi6WmbZg5Uw3/Czlb6ItwpuMCiuwloGHbBxmQ5io+GK7roZuCIVdjB68FspGeOTVIboh0NXXpmG3lfB1fDZKErzSmukhIQQYT8PW3DIaxDJRZ3fXM076svz/njqd2OGOQmUWJvvtPsfd1KgklEVaFi1nofHqmWymKyvqk3uuogMYV1sD/g3UEdkVwpbDpObiwrUO37dKtYk2YrRvuNOtLWxJ6L39itFsuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lbn7hwXJsL9hDPKXKDIP6IrgoRK7fNx2fmnbreDX6sg=; b=MP9XSS7BNuBFuCZMWMdJSxrJFV7e3JXljgqQdirJ+WrWHCDhPspwgejOJR2C7zuvnpFqqyL+aNeKa7UVQarFQ9qRDqzJibG+VWCGSu8wQeAa8ZeHWz0gtm2YM7ofwD8/YlJwZ/rkPuLWvpCoLtrJJ77VcblxflGlzbN/8ajoX0/oBZoCyverJ1ZUnHfRN7sfG0fgY/aZUw/2J6f6mQGRFSzjxBk2LBIHXwWe7Q4d3IlNtbI8RGKDVlEB4IVnpOC6b/DaFOPGOOqLDamC20ao7kgPCMqPjUp4adZwtWcnOtLKW9SOdpe80GubMTt+MpDm6ZVRpK8242Iq3w5RbpXMPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lbn7hwXJsL9hDPKXKDIP6IrgoRK7fNx2fmnbreDX6sg=; b=YM7jeUo84ClzdOrVcNFkZsuSAArQPclJyulyKoWjDJYRj/bfdIvaTzPHXbSfwzo7eL+uLPNVrLR7pxkXs1YRpaDpGQGf9B5kZMZUhOTM040y/ILge8+pLs2dm0C/53f7saHsfF50/zRAmk9n94w7HjJCNmeuvmcB7IMfRT8Kz7Y= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3218.eurprd05.prod.outlook.com (10.170.125.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Tue, 1 Oct 2019 17:15:48 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da9:65ba:1323:a39b]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da9:65ba:1323:a39b%7]) with mapi id 15.20.2305.017; Tue, 1 Oct 2019 17:15:47 +0000 From: Slava Ovsiienko To: Stephen Hemminger CC: "dev@dpdk.org" , Matan Azrad , Raslan Darawsheh , "ferruh.yigit@intel.com" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix compilation issue with gcc pragma Thread-Index: AQHVeEjcdOYFzbZfI0ObYflWiKnW/KdF366AgAACLGA= Date: Tue, 1 Oct 2019 17:15:46 +0000 Message-ID: References: <1569928223-6600-1-git-send-email-viacheslavo@mellanox.com> <20191001075429.70a08442@hermes.lan> In-Reply-To: <20191001075429.70a08442@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7a455a3c-9c36-4601-4993-08d74693008c x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: AM4PR05MB3218:|AM4PR05MB3218: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0177904E6B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(39860400002)(376002)(396003)(366004)(136003)(189003)(199004)(13464003)(6436002)(6116002)(55016002)(52536014)(4326008)(478600001)(8936002)(9686003)(229853002)(3846002)(2906002)(76116006)(14454004)(81156014)(6246003)(66446008)(5660300002)(66556008)(66946007)(64756008)(66476007)(81166006)(8676002)(33656002)(76176011)(305945005)(11346002)(7696005)(86362001)(71190400001)(476003)(6916009)(14444005)(486006)(256004)(99286004)(25786009)(66066001)(7736002)(74316002)(54906003)(102836004)(446003)(186003)(316002)(71200400001)(26005)(6506007)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3218; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gqogokLT//lrcDukTXLjOYn22cIAEZMiClyZmpTlmwqmWgRj30uX4e7+ovtVdhf7+Pnu45ZaB/5b4EoX2qcXoJofVsFy4swhBNArt4QwCWTNy+uActkR8mWU6QEuP9sXOZMvGvr3Xqvq04x0p0BkLwUzbuUfa6QrCgLqoCC0DLBsVXw2a1QvgJmQxIs6CD88XT174BVUZh2y/fpLx4lNwXZBTQoWUm0YG+XfzxkNEPeCgNBVTdHjyKSc5jdz7iMRY8ltwxkU8mvrhMjguzeeQXRx861lUsgZxyN138SQ+ZrPlQi2az+ME3/7sYNqMI5QC51fG1l2kvXTvBz0ZuyeC374wTvanIYFZfQlnxSsuCB2SgdjIztXSF/Uw3dtX2fGFYWdFXC/yk/rpF8wdQAzXBzTIBPe/d33mHQRZ5Neurs= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a455a3c-9c36-4601-4993-08d74693008c X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2019 17:15:47.7256 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vpAHIREaoHnPkTZVm7ZqJBKPv/iW2DN1iT9jaKwQHE/rxE+SdF7GiZ9O77iVFj+RAKFLkjpRa0K5l//8i28fI0NymKYwqIbczkdtynnbNds= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3218 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix compilation issue with gcc pragma X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Stephen Hemminger > Sent: Tuesday, October 1, 2019 17:54 > To: Slava Ovsiienko > Cc: dev@dpdk.org; Matan Azrad ; Raslan > Darawsheh ; ferruh.yigit@intel.com > Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix compilation issue with gcc > pragma >=20 > On Tue, 1 Oct 2019 11:10:23 +0000 > Viacheslav Ovsiienko wrote: >=20 > > +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >=3D 40600) > #pragma GCC > > +diagnostic push > > #pragma GCC diagnostic ignored "-Wformat-nonliteral" > > +#endif > > + /* Use safe format to check maximal buffer length. */ > > while (fscanf(file, format, ifname) =3D=3D 1) { -#pragma GCC diagnost= ic > > error "-Wformat-nonliteral" > > +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >=3D 40600) > #pragma GCC > > +diagnostic pop #endif >=20 > This is messy, is there not a better way to do this? At least I did not find one. The GCC compile-time format checking feature is nice in general and it wort= h=20 to be engaged. The legitimate fscanf() usage with variable format parameter causes GCC to emit error/warning, so we should suppress these ones for this single line. ICC does not emit warning and does not recognize GCC pragmas. Clang just does not recognize fscanf(). Should we use "#ifndef __INTEL_COMPILER" (typical workaround for GCC diagnostic pragma in DPDK)? I'm not sure, It is not completely correct. The alternative I see is to implement dedicated routine to read words from = the file, but it means more code and more run-time resources. It seems not to be=20 the right way to push compile-time issues resolving to the run-time. Defining the macro is not relevant here because this is a single case. WBR, Slava