summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4cdf53c)
scan-build issues the following warning in prepare_ls_row():
aft.c:1338:3: warning: Assigned value is garbage or undefined
GET_NUM_DIGITS(score, &num_digits);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aft.c:719:21: note: expanded from:
typeof((x)) _tmp = PARA_ABS(x); \
^
./para.h:50:2: note: expanded from:
typeof(x) _x = (x); \
^ ~~~
This is because clang can not prove that the "score" variable is
always initialized at this point. However, I can: The problematic
GET_NUM_DIGITS() statement is only executed if LS_FLAG_ADMISSIBLE_ONLY
is set in options->flags, but in this case "score" will be set by
get_score_and_aft_row() because this function only fails to do so if it
returns negative. In this case we return early from prepare_ls_row().
Let's make it easier for clang and initialize it anyway.
ret = get_score_and_aft_row(row, &score, &aft_row);
if (ret < 0)
return ret;
ret = get_score_and_aft_row(row, &score, &aft_row);
if (ret < 0)
return ret;
ret = get_audio_file_path_of_row(aft_row, &path);
if (ret < 0)
return ret;
ret = get_audio_file_path_of_row(aft_row, &path);
if (ret < 0)
return ret;