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.
break;
case MATRIX_TYPE_PATTERN:
for (i = 0; i < nz; i++) {
- fscanf(f, "%d %d\n", &I[i], &J[i]);
+ int num = fscanf(f, "%d %d\n", &I[i], &J[i]);
+ (void)num;
+ assert(num == 2);
I[i]--; /* adjust from 1-based to 0-based */
J[i]--;
}