pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1:   /*   || 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.647 2008/02/03 18:08:51 grubba Exp $ + || $Id: program.c,v 1.648 2008/02/03 19:38:18 grubba Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:2040:    yywarning("Type mismatch when overloading function %S.", name);    yyexplain_nonmatching_types(sub_id->type,    ID_FROM_PTR(Pike_compiler->new_program,    new_ref)->type,    YYTE_IS_WARNING);    }    } else {    struct identifier *new_id;    /* Variable or constant.    * -  * Note: Use weaker check for integers. +  * Note: Use weaker check for integers (especially for constants).    */    if (!pike_types_le(sub_id->type,    (new_id = ID_FROM_PTR(Pike_compiler->new_program,    new_ref))->type) &&    !((i->run_time_type == PIKE_T_INT) &&    (new_id->run_time_type == PIKE_T_INT) && -  match_types(sub_id->type, new_id->type))) { +  (IDENTIFIER_IS_CONSTANT(sub_id->identifier_flags) || +  match_types(sub_id->type, new_id->type)))) {    yywarning("Type mismatch when overloading %S.", name);    yyexplain_nonmatching_types(sub_id->type, new_id->type,    YYTE_IS_WARNING);    }    }    }    }    is_used = ref->id_flags & ID_USED;       *ref=*new_ref;