From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 422FF1B11C for ; Thu, 2 May 2019 17:53:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 08:53:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,422,1549958400"; d="scan'208";a="167044609" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.113]) ([10.237.220.113]) by fmsmga004.fm.intel.com with ESMTP; 02 May 2019 08:53:51 -0700 To: Reshma Pattan , dev@dpdk.org Cc: david.marchand@redhat.com, bruce.richardson@intel.com References: <20190502093334.7546-1-reshma.pattan@intel.com> <20190502141316.25907-1-reshma.pattan@intel.com> From: "Burakov, Anatoly" Message-ID: <276195ae-1dcc-cfff-09af-b5c904fccce0@intel.com> Date: Thu, 2 May 2019 16:53:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190502141316.25907-1-reshma.pattan@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning 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: , X-List-Received-Date: Thu, 02 May 2019 15:53:53 -0000 On 02-May-19 3:13 PM, Reshma Pattan wrote: > gcc 9 on Fedora 30 gives an error > "taking address of packed member may result in an > unaligned pointer value" for -Waddress-of-packed-member. > > Report it as warning instead of error to fix the build. > > Snippet of build before fix > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’: > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address > of packed member of ‘struct rte_mem_config’ may result in an unaligned > pointer value [-Werror=address-of-packed-member] > 768 | cur_msl = &mcfg->memsegs[msl_idx]; > | ^~~~~~~~~~~~~~~~~~~~~~~ > > Snippet of build after fix > ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’: > ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address > of packed member of ‘struct rte_mem_config’ may result in an unaligned > pointer value [-Waddress-of-packed-member] > 685 | msl = &mcfg->memsegs[msl_idx]; > Fixing these would require an ABI break, because these are exposed externally. Should we submit a deprecation notice for EAL? -- Thanks, Anatoly From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EA171A0AC5 for ; Thu, 2 May 2019 17:53:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B57CB1B131; Thu, 2 May 2019 17:53:54 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 422FF1B11C for ; Thu, 2 May 2019 17:53:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 08:53:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,422,1549958400"; d="scan'208";a="167044609" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.113]) ([10.237.220.113]) by fmsmga004.fm.intel.com with ESMTP; 02 May 2019 08:53:51 -0700 To: Reshma Pattan , dev@dpdk.org Cc: david.marchand@redhat.com, bruce.richardson@intel.com References: <20190502093334.7546-1-reshma.pattan@intel.com> <20190502141316.25907-1-reshma.pattan@intel.com> From: "Burakov, Anatoly" Message-ID: <276195ae-1dcc-cfff-09af-b5c904fccce0@intel.com> Date: Thu, 2 May 2019 16:53:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190502141316.25907-1-reshma.pattan@intel.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning 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" Message-ID: <20190502155350.6U140RkknN8cLZ5keC39c_7sselN2djfLLPoOy3k7xY@z> On 02-May-19 3:13 PM, Reshma Pattan wrote: > gcc 9 on Fedora 30 gives an error > "taking address of packed member may result in an > unaligned pointer value" for -Waddress-of-packed-member. > > Report it as warning instead of error to fix the build. > > Snippet of build before fix > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’: > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address > of packed member of ‘struct rte_mem_config’ may result in an unaligned > pointer value [-Werror=address-of-packed-member] > 768 | cur_msl = &mcfg->memsegs[msl_idx]; > | ^~~~~~~~~~~~~~~~~~~~~~~ > > Snippet of build after fix > ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’: > ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address > of packed member of ‘struct rte_mem_config’ may result in an unaligned > pointer value [-Waddress-of-packed-member] > 685 | msl = &mcfg->memsegs[msl_idx]; > Fixing these would require an ABI break, because these are exposed externally. Should we submit a deprecation notice for EAL? -- Thanks, Anatoly