Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36e0d8b

Browse files
committed
BUG: printf requires a literal for the first argument.
Not sure why this shows up as a warning on py2.x but as an error on py3.x.
1 parent a837853 commit 36e0d8b

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

numpy/core/test_c99complex.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,7 @@ int check_near_crossover(complexfunc cfunc, const char* fname)
395395

396396
diff = ADDSUFFIX(cabs)(czp - czm);
397397
if ( diff > 2*EPS || czp == czm) {
398-
printf(fname);
399-
printf(": Loss of precision: j = %d, k = %d\n", j, k);
398+
printf("%s: Loss of precision: j = %d, k = %d\n",fname, j, k);
400399
printf("zp = (" FMT " + " FMT "j) -> (" FMT " + " FMT "j)\n", \
401400
ADDSUFFIX(creal)(zp), ADDSUFFIX(cimag)(zp), \
402401
ADDSUFFIX(creal)(czp), ADDSUFFIX(cimag)(czp));
@@ -453,8 +452,7 @@ int check_loss_of_precision(complexfunc cfunc, realfunc rfunc, int real,
453452
x = ADDSUFFIX(pow)(10.0, xsb + k*dxs);
454453
ratio = clp_internal(cfunc, rfunc, real, x);
455454
if (ratio > rtol) {
456-
printf(fname);
457-
printf(": Loss of precision vs real:\n");
455+
printf("%s: Loss of precision vs real:\n", fname);
458456
printf("x = " FMT "\n", x);
459457
printf("ratio = " FMT "\n", ratio);
460458
ret = 0;
@@ -465,8 +463,7 @@ int check_loss_of_precision(complexfunc cfunc, realfunc rfunc, int real,
465463
x = ADDSUFFIX(pow)(10.0, xbb + k*dxb);
466464
ratio = clp_internal(cfunc, rfunc, real, x);
467465
if (ratio > rtol) {
468-
printf(fname);
469-
printf(": Loss of precision vs. real:\n");
466+
printf("%s: Loss of precision vs. real:\n", fname);
470467
printf("x = " FMT "\n", x);
471468
printf("ratio = " FMT "\n", ratio);
472469
ret = 0;

0 commit comments

Comments
 (0)