[ofa-general] [PATCH] infiniband-diags/ibdiag_common.c: Eliminate compile warning on x86_64 archs

Hal Rosenstock hnrose at comcast.net
Fri May 29 12:31:12 PDT 2009


src/ibdiag_common.c: In function pretty_print
src/ibdiag_common.c:95: warning: field precision should have type int,
but argument 3 has type long int

Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
---
diff --git a/infiniband-diags/src/ibdiag_common.c b/infiniband-diags/src/ibdiag_common.c
index 4ffa3f0..6fb8e01 100644
--- a/infiniband-diags/src/ibdiag_common.c
+++ b/infiniband-diags/src/ibdiag_common.c
@@ -92,7 +92,7 @@ static void pretty_print(int start, int width, const char *str)
 		}
 		if (e - str == 1)
 			e = p;
-		fprintf(stderr, "%.*s\n%*s", e - str, str, start, "");
+		fprintf(stderr, "%.*s\n%*s", (int)(e - str), str, start, "");
 		str = e;
 	}
 }



More information about the general mailing list