From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 6 03:20:00 2012 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A111937F for ; Thu, 6 Dec 2012 03:20:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 737748FC0C for ; Thu, 6 Dec 2012 03:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qB63K0KO088082 for ; Thu, 6 Dec 2012 03:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qB63K0cs088081; Thu, 6 Dec 2012 03:20:00 GMT (envelope-from gnats) Resent-Date: Thu, 6 Dec 2012 03:20:00 GMT Resent-Message-Id: <201212060320.qB63K0cs088081@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC55E230 for ; Thu, 6 Dec 2012 03:15:58 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 88B388FC14 for ; Thu, 6 Dec 2012 03:15:58 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qB63Fwso040902 for ; Thu, 6 Dec 2012 03:15:58 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id qB63FwVh040901; Thu, 6 Dec 2012 03:15:58 GMT (envelope-from nobody) Message-Id: <201212060315.qB63FwVh040901@red.freebsd.org> Date: Thu, 6 Dec 2012 03:15:58 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/174214: [patch] OFED userspace fails to build with clang X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 03:20:00 -0000 >Number: 174214 >Category: bin >Synopsis: [patch] OFED userspace fails to build with clang >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 06 03:20:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9.1-RC2 >Organization: EMC Isilon >Environment: FreeBSD gran-tourismo.west.isilon.com 9.1-RC2 FreeBSD 9.1-RC2 #0 r241106: Mon Oct 1 18:26:44 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: When trying to upgrade one of the dev boxes I have at my disposal to CURRENT with WITH_OFED defined in /etc/src.conf, I ran into a handful of trivial compilation issues with clang, dealing with printf(3)/variable buffers, and GCCisms. The attached patch fixes them. I need to check and see whether or not a newer version of OFED fixes this, but this gets things to work again. If it's still an issue, I'll push for integration upstream. >How-To-Repeat: >Fix: Patch attached with submission follows: >From 4b40ec9924c1f509637284f5dfb745517c024608 Mon Sep 17 00:00:00 2001 From: Garrett Cooper Date: Wed, 5 Dec 2012 18:51:14 -0800 Subject: [PATCH] Make ofed userspace build with clang Signed-off-by: Garrett Cooper --- contrib/ofed/management/infiniband-diags/src/sminfo.c | 8 ++++---- contrib/ofed/management/opensm/opensm/osm_console.c | 5 ++++- contrib/ofed/management/opensm/opensm/osm_subnet.c | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/contrib/ofed/management/infiniband-diags/src/sminfo.c b/contrib/ofed/management/infiniband-diags/src/sminfo.c index c811057..61d88e1 100644 --- a/contrib/ofed/management/infiniband-diags/src/sminfo.c +++ b/contrib/ofed/management/infiniband-diags/src/sminfo.c @@ -72,10 +72,10 @@ enum { }; char *statestr[] = { - [SMINFO_NOTACT] "SMINFO_NOTACT", - [SMINFO_DISCOVER] "SMINFO_DISCOVER", - [SMINFO_STANDBY] "SMINFO_STANDBY", - [SMINFO_MASTER] "SMINFO_MASTER", + "SMINFO_NOTACT", + "SMINFO_DISCOVER", + "SMINFO_STANDBY", + "SMINFO_MASTER", }; #define STATESTR(s) (((unsigned)(s)) < SMINFO_STATE_LAST ? statestr[s] : "???") diff --git a/contrib/ofed/management/opensm/opensm/osm_console.c b/contrib/ofed/management/opensm/opensm/osm_console.c index c6e8e59..5c494a8 100644 --- a/contrib/ofed/management/opensm/opensm/osm_console.c +++ b/contrib/ofed/management/opensm/opensm/osm_console.c @@ -67,7 +67,10 @@ static struct { time_t previous; void (*loop_function) (osm_opensm_t * p_osm, FILE * out); } loop_command = { -on: 0, delay_s: 2, loop_function:NULL}; + .on = 0, + .delay_s = 2, + .loop_function = NULL, +}; static const struct command console_cmds[]; diff --git a/contrib/ofed/management/opensm/opensm/osm_subnet.c b/contrib/ofed/management/opensm/opensm/osm_subnet.c index c41962d..558027c 100644 --- a/contrib/ofed/management/opensm/opensm/osm_subnet.c +++ b/contrib/ofed/management/opensm/opensm/osm_subnet.c @@ -482,7 +482,7 @@ static void log_report(const char *fmt, ...) va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - printf(buf); + printf("%s", buf); cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0); } @@ -500,7 +500,7 @@ static void log_config_value(char *name, const char *fmt, ...) n = sizeof(buf); snprintf(buf + n, sizeof(buf) - n, "\n"); va_end(args); - printf(buf); + printf("%s", buf); cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0); } -- 1.8.0.1 >Release-Note: >Audit-Trail: >Unformatted: