From: ellson Date: Mon, 3 Jul 2006 12:05:11 +0000 (+0000) Subject: work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt(d)" X-Git-Tag: LAST_LIBGRAPH~32^2~6195 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dfd6ab3449455907a5a684fb54cb8b54c5befd5;p=graphviz work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt(d)" but sqrtf doesn't exist in libm.a. reported by: Aaron Digulla --- diff --git a/lib/neatogen/matrix_ops.c b/lib/neatogen/matrix_ops.c index 5c85f56ba..1fce7fb4c 100644 --- a/lib/neatogen/matrix_ops.c +++ b/lib/neatogen/matrix_ops.c @@ -726,8 +726,11 @@ void invert_vec(int n, float *vec) void sqrt_vec(int n, float *vec) { int i; + double d; for (i = 0; i < n; i++) { - vec[i] = (float) sqrt(vec[i]); + /* do this in two steps to avoid a bug in gcc-4.00 on AIX */ + d = sqrt(vec[i]); + vec[i] = (float) d; } }