Branch: Tag:

2008-01-03

2008-01-03 16:49:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Only warn about unused variables in the second pass.

Rev: src/program.c:1.634

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.633 2008/01/03 15:58:27 grubba Exp $ + || $Id: program.c,v 1.634 2008/01/03 16:49:46 grubba Exp $   */      #include "global.h"
8221:    {    int e;    e=--(Pike_compiler->compiler_frame->current_number_of_locals); -  if (!(Pike_compiler->compiler_frame->variable[e].flags & +  if ((Pike_compiler->compiler_pass == 2) && +  !(Pike_compiler->compiler_frame->variable[e].flags &    LOCAL_VAR_IS_USED)) {    struct pike_string *save_file = lex.current_file;    int save_line = lex.current_line;
8251: Inside #if 1
   * actually is used from a nested scope. */    for(;level<Pike_compiler->compiler_frame->min_number_of_locals;level++)    { -  if (!(Pike_compiler->compiler_frame->variable[level].flags & +  if ((Pike_compiler->compiler_pass == 2) && +  !(Pike_compiler->compiler_frame->variable[level].flags &    LOCAL_VAR_IS_USED)) {    struct pike_string *save_file = lex.current_file;    int save_line = lex.current_line;