From patchwork Mon Oct 9 13:12:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Morey-Chaisemartin X-Patchwork-Id: 9993055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A79C60230 for ; Mon, 9 Oct 2017 13:12:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDAB728517 for ; Mon, 9 Oct 2017 13:12:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E29A128750; Mon, 9 Oct 2017 13:12:07 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5345828517 for ; Mon, 9 Oct 2017 13:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754323AbdJINME (ORCPT ); Mon, 9 Oct 2017 09:12:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:60229 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636AbdJINMD (ORCPT ); Mon, 9 Oct 2017 09:12:03 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 206E3AABA; Mon, 9 Oct 2017 13:12:02 +0000 (UTC) Subject: Re: [PATCH rdma-core] verbs: Fix C++ compilation break To: Leon Romanovsky , Doug Ledford Cc: linux-rdma@vger.kernel.org, Leon Romanovsky , Nelio Laranjeiro , Adrien Mazarguil , Jason Gunthorpe References: <20171009081717.21478-1-leon@kernel.org> From: Nicolas Morey-Chaisemartin Openpgp: preference=signencrypt Message-ID: <537d72a7-19c3-d13d-4b49-538744a73845@suse.de> Date: Mon, 9 Oct 2017 15:12:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 MIME-Version: 1.0 In-Reply-To: <20171009081717.21478-1-leon@kernel.org> Content-Language: en-US Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Le 09/10/2017 à 10:17, Leon Romanovsky a écrit : > From: Leon Romanovsky > > The commit 983f80191923 ("verbs: fix compilation error with ICC") fixed > warning by using UINTPTR_MAX, however such change breaks compilation > of C++ applications. > > In C++ world, the UINTPTR_MAX is declared in and not stdint.h, > so in order to avoid messing with various defines to decide which header > file include: stdint.h or , we will check for the existence > of UINTPTR_MAX and will fallback to old implementation. > > Fixes: 983f80191923 ("verbs: fix compilation error with ICC") > Signed-off-by: Leon Romanovsky > Cc: Nelio Laranjeiro > Cc: Adrien Mazarguil > Cc: Jason Gunthorpe > --- > libibverbs/verbs.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h > index cc633a12..f540b660 100644 > --- a/libibverbs/verbs.h > +++ b/libibverbs/verbs.h > @@ -82,7 +82,11 @@ union ibv_gid { > > #define vext_field_avail(type, fld, sz) (offsetof(type, fld) < (sz)) > > +#ifdef UINTPTR_MAX > static void *__VERBS_ABI_IS_EXTENDED = (void *)UINTPTR_MAX; > +#else > +static void *__VERBS_ABI_IS_EXTENDED = ((uint8_t *) NULL) - 1; > +#endif > > enum ibv_node_type { > IBV_NODE_UNKNOWN = -1, > -- > 2.14.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Wouldn't something like this solve the issue without messing up the code ? --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 8cdf8ab5..c5d932bf 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -44,6 +44,7 @@  #include    #ifdef __cplusplus +#include   #  define BEGIN_C_DECLS extern "C" {  #  define END_C_DECLS   }  #else /* !__cplusplus */