From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] net/mlx: fix compile errors with ignore pedantic pragma Date: Fri, 30 Sep 2016 15:33:00 +0100 Message-ID: <78fe6c4a-b57a-a4e5-5317-29d4b1238023@intel.com> References: <1474295814-4879-1-git-send-email-bruce.richardson@intel.com> <20160919145959.GB17252@6wind.com> <20160919152605.GG45548@bricha3-MOBL3> <20160920125126.GG17252@6wind.com> <20160920155848.GA74952@bricha3-MOBL3> <20160920181751.GJ17252@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: Adrien Mazarguil , Bruce Richardson Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 274A5137C for ; Fri, 30 Sep 2016 16:33:03 +0200 (CEST) In-Reply-To: <20160920181751.GJ17252@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/20/2016 7:17 PM, Adrien Mazarguil wrote: > On Tue, Sep 20, 2016 at 04:58:48PM +0100, Bruce Richardson wrote: >> On Tue, Sep 20, 2016 at 02:51:27PM +0200, Adrien Mazarguil wrote: >>> On Mon, Sep 19, 2016 at 04:26:05PM +0100, Bruce Richardson wrote: >>>> On Mon, Sep 19, 2016 at 04:59:59PM +0200, Adrien Mazarguil wrote: >>>>> Hi Bruce, >>>>> >>>>> On Mon, Sep 19, 2016 at 03:36:54PM +0100, Bruce Richardson wrote: >>>>>> With recent gcc versions, e.g. gcc 6.1, compilation of mlx drivers with >>>>>> debug enabled produces lots of errors complaining that "pedantic" is >>>>>> not a warning level that can be ignored. >>>>>> >>>>>> error: ‘-pedantic’ is not an option that controls warnings [-Werror=pragmas] >>>>>> #pragma GCC diagnostic ignored "-pedantic" >>>>>> ^~~~~~~~~~~ >>>>>> >>>>>> These errors can be removed by changing the "-pedantic" to "-Wpedantic". >>>>> >>>>> Nice to have a workaround, I thought they did not keep the option at all. >>>>> However after testing: >>>>> >>>>> - It does not seem to work with GCC 4.6 and older, they prefer -pedantic: >>>>> "warning: unknown option after `#pragma GCC diagnostic' kind". >>>>> >>>>> - GCC 4.9 (possibly 5.x as well) does not care, can use either -pedantic or >>>>> -Wpedantic. >>>>> >>>>> - GCC 6 can only supports -Wpedantic. >>>>> >>>>> Note we're working toward removing the need for these #pragma in the first >>>>> place as soon as possible, however in the meantime I fear that checking the >>>>> GCC version is necessary. >>>>> >>>> Depends on how old of GCC version we need to support. From the release notes >>>> it appears that -Wpedantic was introduced in GCC 4.8 (3 1/2 years ago). >>>> >>>> https://gcc.gnu.org/gcc-4.8/changes.html >>>> >>>> Do we need to support compilation on gcc versions older than this? >>> >>> I'm all for upgrading so I do not really mind if we stop caring about older >>> GCC versions (especially considering this problem only occurs in debugging >>> mode which is seldom used by non-developers). The version check is necessary >>> if we want to keep full compatibility with at least: >>> >>> - RHEL <= 6.x >>> - Debian <= 7.x >>> - Ubuntu <= 13.04 >>> >>> Works for me either way, thus: >>> >>> Acked-by: Adrien Mazarguil >>> >> Any objections to dropping of support for debug settings for these OS's? > > Not sure who should answer this. These #pragma are workarounds we should > eventually get rid of anyway (DPDK headers are now clean enough, some work > remains to be done on the Verbs side) so let's use your patch in the > meantime. > Just as a quick note, this breaks compilation for ICC: .../drivers/net/mlx4/mlx4.c(64): error #2282: unrecognized GCC pragma #pragma GCC diagnostic ignored "-Wpedantic" Since this compilation error only happens for MLX4/5 when debug config option enabled, this not big issue, but please aware of the issue. Thanks, ferruh