TREE_USED and DECL_READ_P

2018-07-20 Thread via gcc
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(

What is the difference between datatype "const_tree" and "tree" ?

2018-07-04 Thread via gcc
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

What is dump_file in gcc ?

2018-06-06 Thread via gcc
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 ?

I want to know the information about the function arguments

2018-06-06 Thread via gcc
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

I want to dump something when I compile the program. How should I do ?

2018-05-16 Thread via gcc
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