GCC Edition:7.3.0
I find in source code/gcc/c/c-decl.c ,
Line 1265 to 1281 decides what situation leads to warnings for unused variables
I am confused about line 1266:
I think only the DECL_READ_P is enough for program to
decides the warning for unused variables, so I can elmiminate
" !TREE_USED(
In the function emit_side_effect_warnings, I find its inputs are "location_t
loc" and "tree expr".
And, there is a function warn_if_unused_value called by
emit_side_effect_warnings:
emit_side_effect_warnings(location_t loc, tree expr){ ...
else
warn_if_unused_value(expr,loc)
}
To
I have ever seen "fprintf(dump_file,"something writes into dump_file") many
times.
I want to know what dump_file is and how can I check its content ?
When I modify the gcc source code, sometimes I do not know what parameters does
the function call.
For example,
bool warn_if_unused_value(const tree exp,location_t locus){ function
declaration ...
}
I want to know what "exp" and "locus" are by using fprintf such as
fprintf(stderr,"%s\n%s\n",e
My work is to modify the gcc source code so as to customize the warning
message, when the programmer writing the program violating some rules.
When the violation occurs, I want to reveal some message such as "guanjen375
warning: the rule ### is violated" on the window.
How should I do ? Should I