I ran it through the preprocessor by doing gcc -E -o libcsv_pre.c libcsv.c and compared the preprocessed source with the original. Indeed, pstate is set several times in code generated by macros, so just removing line 163 isn't the best option. However, its value is never read, AFAICT.
Did you originally intend to set the parser's p->pstate from the local variable before returning, or before calling one of the callbacks?
There is an "unused but set variable" warning from gcc when compiling libcsv:
If you could fix this, it will compile without any warnings.
Suggestion: go to line 171 in libcsv.c and change this line:
to this:
I ran it through the preprocessor by doing
gcc -E -o libcsv_pre.c libcsv.c
and compared the preprocessed source with the original. Indeed,pstate
is set several times in code generated by macros, so just removing line 163 isn't the best option. However, its value is never read, AFAICT.Did you originally intend to set the parser's
p->pstate
from the local variable before returning, or before calling one of the callbacks?