From patchwork Fri Apr 13 23:29:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 10340865 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 4C3AA60153 for ; Fri, 13 Apr 2018 23:29:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32B9A28A33 for ; Fri, 13 Apr 2018 23:29:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24F9828A3E; Fri, 13 Apr 2018 23:29: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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,T_TVD_MIME_EPI 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 BC2F028A33 for ; Fri, 13 Apr 2018 23:29:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750989AbeDMX3u (ORCPT ); Fri, 13 Apr 2018 19:29:50 -0400 Received: from linode.aoot.com ([69.164.194.13]:47202 "EHLO linode.aoot.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbeDMX3u (ORCPT ); Fri, 13 Apr 2018 19:29:50 -0400 Received: from stevoacer (47-221-140-100.gtwncmta03.res.dyn.suddenlink.net [47.221.140.100]) by linode.aoot.com (Postfix) with ESMTP id 027A9821C; Fri, 13 Apr 2018 18:29:49 -0500 (CDT) From: "Steve Wise" To: "'Jason Gunthorpe'" Cc: "'Leon Romanovsky'" , , "'RDMA mailing list'" References: <01ea01d3d34e$32fe6900$98fb3b00$@opengridcomputing.com> <20180413192320.26wjzlftdqdz2ieb@mellanox.com> In-Reply-To: <20180413192320.26wjzlftdqdz2ieb@mellanox.com> Subject: RE: rdma-core compiler warnings on RHEL6.8 Date: Fri, 13 Apr 2018 18:29:47 -0500 Message-ID: <007101d3d37f$4ffdb250$eff916f0$@opengridcomputing.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGi5vwhxQhpryH1ChkAOq90fTYWXwG27LfppFN3GOA= 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 > > If you can make a simple test program that triggers the above warning > send it to me and I will make cmake turn off strict aliasing globally if the > compiler is too old.. > > Jason > Hey Jason, Attached is bar.c, that if you build in libibverbs/examples, will show these two warnings. EG: index dc4c497..84b5813 100644 +rdma_executable(bar bar.c) ---- [ 84%] Building C object libibverbs/examples/CMakeFiles/bar.dir/bar.c.o /root/stevo/rdma-core/libibverbs/examples/bar.c: In function 'bar': /root/stevo/rdma-core/libibverbs/examples/bar.c:67: warning: comparison of unsigned expression < 0 is always false /root/stevo/rdma-core/libibverbs/examples/bar.c: In function 'main': /root/stevo/rdma-core/libibverbs/examples/bar.c:43: warning: dereferencing pointer 'sgid.103' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/examples/bar.c:42: warning: dereferencing pointer 'sgid.103' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/examples/bar.c:41: warning: dereferencing pointer 'sgid.103' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/examples/bar.c:44: warning: dereferencing pointer 'sgid.103' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/examples/bar.c:51: note: initialized from here Linking C executable ../../bin/bar --- Thanks! Steve. --- a/libibverbs/examples/CMakeLists.txt +++ b/libibverbs/examples/CMakeLists.txt @@ -26,3 +26,4 @@ target_link_libraries(ibv_ud_pingpong LINK_PRIVATE ibverbs ibverbs_tools) rdma_executable(ibv_xsrq_pingpong xsrq_pingpong.c) target_link_libraries(ibv_xsrq_pingpong LINK_PRIVATE ibverbs ibverbs_tools)