From: Costa Shulyupin Date: Sun, 3 Apr 2022 08:10:41 +0000 (+0300) Subject: squash warning in SparseMatrix_import_matrix_market/MATRIX_TYPE_COMPLEX X-Git-Tag: 4.0.0~131^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d0b5e5baba066c0450b91786aaf68390b76d196;p=graphviz squash warning in SparseMatrix_import_matrix_market/MATRIX_TYPE_COMPLEX warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result] On success, these functions return the number of input items successfully matched and assigned; this can be fewer than provided for, or even zero, in the event of an early matching failure. --- diff --git a/cmd/tools/matrix_market.c b/cmd/tools/matrix_market.c index 83db92fd7..5b74deec1 100644 --- a/cmd/tools/matrix_market.c +++ b/cmd/tools/matrix_market.c @@ -213,7 +213,9 @@ SparseMatrix SparseMatrix_import_matrix_market(FILE * f, int format) val = malloc(2 * nz * sizeof(double)); v = val; for (i = 0; i < nz; i++) { - fscanf(f, "%d %d %lg %lg\n", &I[i], &J[i], &v[0], &v[1]); + int num = fscanf(f, "%d %d %lg %lg\n", &I[i], &J[i], &v[0], &v[1]); + (void)num; + assert(num == 4); v += 2; I[i]--; /* adjust from 1-based to 0-based */ J[i]--;