2013/6/16 Chung-Ju Wu <jasonw...@gmail.com>: > Hi Balaji, > > I was building a native gcc with trunk r200117, > but I noticed the following code fragment cause -Wenum-compare warning: > > > [gcc/c-family/array-notation-common.c] > > 483 /* This function is used by C and C++ front-ends. In C++, additional > 484 tree codes such as TARGET_EXPR must be eliminated. These codes are > 485 passed into additional_tcodes and are walked through and checked. */ > 486 for (ii = 0; ii < vec_safe_length (i_list->additional_tcodes); ii++) > 487 if (TREE_CODE (*tp) == (enum rid)(*(i_list->additional_tcodes))[ii]) > 488 *walk_subtrees = 0; > > > /gcc-4.9.0/gcc/c-family/array-notation-common.c: In function > 'tree_node* find_inv_trees(tree_node**, int*, void*)': > /gcc-4.9.0/gcc/c-family/array-notation-common.c:487:68: warning: > comparison between 'enum tree_code' and 'enum rid' [-Wenum-compare] > if (TREE_CODE (*tp) == (enum rid)(*(i_list->additional_tcodes))[ii]) > ^ >
Thanks, Balaji, I can see this warning is fixed with following patch: http://gcc.gnu.org/ml/gcc-patches/2013-06/msg01217.html http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=200272 Best regards, jasonwucj