From patchwork Fri Apr 13 17:38:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 10340685 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 9DDB76039A for ; Fri, 13 Apr 2018 17:38:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C42E28979 for ; Fri, 13 Apr 2018 17:38:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80CA52897B; Fri, 13 Apr 2018 17:38:18 +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 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 0FDDC28973 for ; Fri, 13 Apr 2018 17:38:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750792AbeDMRiR (ORCPT ); Fri, 13 Apr 2018 13:38:17 -0400 Received: from linode.aoot.com ([69.164.194.13]:46978 "EHLO linode.aoot.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbeDMRiQ (ORCPT ); Fri, 13 Apr 2018 13:38:16 -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 E0D4F87B0; Fri, 13 Apr 2018 12:38:15 -0500 (CDT) From: "Steve Wise" To: "'Jason Gunthorpe'" Cc: "'Leon Romanovsky'" , , "'RDMA mailing list'" Subject: rdma-core compiler warnings on RHEL6.8 Date: Fri, 13 Apr 2018 12:38:13 -0500 Message-ID: <01ea01d3d34e$32fe6900$98fb3b00$@opengridcomputing.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdPTTjKTQM+YiwbuQnaHTyqOtm/sQg== 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 Hey guys, compiling rdma-core on RHEL6.8 shows at least two sets of warnings. Should these be fixed? 1) enum type treated as a signed int: /root/stevo/rdma-core/libibverbs/enum_strs.c: In function 'ibv_port_state_str': /root/stevo/rdma-core/libibverbs/enum_strs.c:63: warning: comparison of unsigned expression < 0 is always false /root/stevo/rdma-core/libibverbs/enum_strs.c: In function 'ibv_event_type_str': /root/stevo/rdma-core/libibverbs/enum_strs.c:94: warning: comparison of unsigned expression < 0 is always false /root/stevo/rdma-core/libibverbs/enum_strs.c: In function 'ibv_wc_status_str': /root/stevo/rdma-core/libibverbs/enum_strs.c:129: warning: comparison of unsigned expression < 0 is always false 2) strict aliasing warnings: /root/stevo/rdma-core/libibverbs/verbs.c: In function 'ibv_init_ah_from_wc': /root/stevo/rdma-core/libibverbs/verbs.c:648: warning: dereferencing pointer 'sgid.163' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/verbs.c:647: warning: dereferencing pointer 'sgid.163' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/verbs.c:646: warning: dereferencing pointer 'sgid.163' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/verbs.c:645: warning: dereferencing pointer 'sgid.163' does break strict-aliasing rules /root/stevo/rdma-core/libibverbs/verbs.c:724: note: initialized from here I avoided #2 by adding this...but is there some way to do this only for certain compilers? --- Steve. -- 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/CMakeLists.txt b/libibverbs/CMakeLists.txt index 7218783..29998f6 100644 --- a/libibverbs/CMakeLists.txt +++ b/libibverbs/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}") + publish_headers(infiniband arch.h opcode.h