pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:3142:       sub_ref = PTR_FROM_INT(inh->prog, cur_id - inh->identifier_level);       /* Check if the symbol was used before it was inherited. */    if ((c->lex.pragmas & ID_STRICT_TYPES) &&    (sub_ref->id_flags & ID_USED)) {    struct identifier *sub_id = ID_FROM_PTR(inh->prog, sub_ref);    if (IDENTIFIER_IS_FUNCTION(sub_id->identifier_flags)) {    if ((Pike_compiler->compiler_pass == COMPILER_PASS_LAST) &&    !pike_types_le(ID_FROM_PTR(Pike_compiler->new_program, -  new_ref)->type, sub_id->type)) { +  new_ref)->type, sub_id->type, 0, 0)) {    yytype_report(REPORT_WARNING,    NULL, 0, sub_id->type,    NULL, 0, ID_FROM_PTR(Pike_compiler->new_program,    new_ref)->type,    0, "Type mismatch when overloading function %S.",    name);    }    } else {    struct identifier *new_id;    /* Variable or constant.    *    * 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) && +  new_ref))->type, 0, 0) &&    !((i->run_time_type == PIKE_T_INT) &&    (new_id->run_time_type == PIKE_T_INT) &&    (IDENTIFIER_IS_CONSTANT(sub_id->identifier_flags) ||    match_types(sub_id->type, new_id->type)))) {    yytype_report(REPORT_WARNING,    NULL, 0, sub_id->type,    NULL, 0, new_id->type,    0, "Type mismatch when overloading %S.", name);    }    }
pike.git/src/program.c:3333:    * It looks like it already is done by define_function().    *    * Yes -- It's needed in case of mixin.    */    if(funa_is_prototype && (funb->func.offset != -1) &&    !(funp->id_flags & ID_INLINE))    {    if ((c->lex.pragmas & ID_STRICT_TYPES) &&    (funp->id_flags & ID_USED)) {    /* Verify that the types are compatible. */ -  if (!pike_types_le(funb->type, fun->type)) { +  if (!pike_types_le(funb->type, fun->type, 0, 0)) {    yytype_report(REPORT_WARNING, NULL, 0, fun->type,    NULL, 0, funb->type,    0, "Type mismatch when overloading %S.",    fun->name);    }    }    funp->inherit_offset = funpb->inherit_offset;    funp->identifier_offset = funpb->identifier_offset;    }    if(!funa_is_prototype && funb->func.offset == -1)    {    if ((c->lex.pragmas & ID_STRICT_TYPES) &&    (funpb->id_flags & ID_USED)) {    /* Verify that the types are compatible. */ -  if (!pike_types_le(fun->type, funb->type)) { +  if (!pike_types_le(fun->type, funb->type, 0, 0)) {    yytype_report(REPORT_WARNING, NULL, 0, funb->type,    NULL, 0, fun->type,    0, "Type mismatch when overloading %S.",    fun->name);    }    }    funpb->inherit_offset = funp->inherit_offset;    funpb->identifier_offset = funp->identifier_offset;    }    }
pike.git/src/program.c:6362:    return;    }       if (Pike_compiler->compiler_pass != COMPILER_PASS_FIRST) {    /* Note off by one! */    inherit_offset = Pike_compiler->num_inherits + 1;    }       fix_type_field(n);    -  if (!pike_types_le(n->type, inheritable_type_string) && +  if (!pike_types_le(n->type, inheritable_type_string, 0, 0) &&    (THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES)) {    yytype_report(REPORT_WARNING,    n->current_file, n->line_number, inheritable_type_string,    n->current_file, n->line_number, n->type,    0, "Program required for inherit.");    }       switch(n->token)    {    case F_EXTERNAL:
pike.git/src/program.c:6809:    my_yyerror("Illegal to redefine 'final' "    "variable/functions %S", name);       if(!(IDENTIFIERP(n)->id_flags & ID_INLINE) ||    Pike_compiler->compiler_pass != COMPILER_PASS_FIRST)    {    int n2;       if(ID_FROM_INT(Pike_compiler->new_program, n)->type != type &&    !pike_types_le(type, -  ID_FROM_INT(Pike_compiler->new_program, n)->type)) { +  ID_FROM_INT(Pike_compiler->new_program, n)->type, +  0, 0)) {    int level = REPORT_WARNING;    if (!match_types(ID_FROM_INT(Pike_compiler->new_program, n)->type,    type)) {    level = REPORT_ERROR;    }    yytype_report(level, NULL, 0,    ID_FROM_INT(Pike_compiler->new_program, n)->type,    NULL, 0, type, 0,    "Illegal to redefine inherited variable %S "    "with different type.", name);
pike.git/src/program.c:7367:    SEE_PROTECTED) < 0) {    /* One of them is missing. */    goto skip_special_cases;    }    }    }    }    }    /* Inhibit deprecation warnings during the comparison. */    c->lex.pragmas |= ID_NO_DEPRECATION_WARNINGS; -  if (!pike_types_le(type, lfun_type->u.type)) { +  if (!pike_types_le(type, lfun_type->u.type, 0, 0)) {    int level = REPORT_NOTICE;    if (!match_types(type, lfun_type->u.type)) {    level = REPORT_ERROR;    } else if (c->lex.pragmas & ID_STRICT_TYPES) {    level = REPORT_WARNING;    }    if (level != REPORT_NOTICE) {    yytype_report(level,    NULL, 0, lfun_type->u.type,    NULL, 0, type,
pike.git/src/program.c:7429:    symbol = string_slice(name, delta, name->len-(delta+1));    symbol_type = get_argument_type(type, 0);    }       if (symbol) {    /* We got a getter or a setter. */    struct reference *ref;    int orig_pragmas = c->lex.pragmas;    /* Inhibit deprecation warnings during the comparison. */    c->lex.pragmas |= ID_NO_DEPRECATION_WARNINGS; -  if (!pike_types_le(type, gs_type)) { +  if (!pike_types_le(type, gs_type, 0, 0)) {    int level = REPORT_NOTICE;    if (!match_types(type, gs_type)) {    level = REPORT_ERROR;    } else if (c->lex.pragmas & ID_STRICT_TYPES) {    level = REPORT_WARNING;    }    yytype_report(level, NULL, 0, gs_type,    NULL, 0, type, 0,    "Type mismatch for callback function %S:", name);    }
pike.git/src/program.c:10460:    if (i == -1) {    if (b->identifier_references[e].id_flags & (ID_OPTIONAL))    continue; /* It's ok... */   #if 0    fprintf(stderr, "Missing identifier \"%s\"\n", bid->name->str);   #endif /* 0 */    ret = 0;    break;    }    -  if (!pike_types_le(bid->type, ID_FROM_INT(a, i)->type)) { +  if (!pike_types_le(bid->type, ID_FROM_INT(a, i)->type, 0, 0)) {    if(!match_types(ID_FROM_INT(a,i)->type, bid->type)) {   #if 0    fprintf(stderr, "Identifier \"%s\" is incompatible.\n",    bid->name->str);   #endif /* 0 */    ret = 0;    break;    } else {   #if 0    fprintf(stderr, "Identifier \"%s\" is not strictly compatible.\n",
pike.git/src/program.c:10763:    continue; /* It's ok... */    bid_file = get_identifier_line(b, e, &bid_line);    if (!bid_file) bid_file = b_file;    yytype_report(severity_level,    bid_file, bid_line, bid->type,    a_file, a_line, NULL,    0, "Missing identifier %S.", bid->name);    continue;    }    -  if (!pike_types_le(bid->type, ID_FROM_INT(a, i)->type)) { +  if (!pike_types_le(bid->type, ID_FROM_INT(a, i)->type, 0, 0)) {    INT_TYPE aid_line = a_line;    INT_TYPE bid_line = b_line;    struct pike_string *aid_file = get_identifier_line(a, i, &aid_line);    struct pike_string *bid_file = get_identifier_line(b, e, &bid_line);    if (!aid_file) aid_file = a_file;    if (!bid_file) bid_file = b_file;    if(!match_types(ID_FROM_INT(a,i)->type, bid->type)) {    yytype_report(severity_level,    bid_file, bid_line, bid->type,    aid_file, aid_line, ID_FROM_INT(a, i)->type,
pike.git/src/program.c:10893:    if (b->identifier_references[e].id_flags & (ID_OPTIONAL))    continue; /* It's ok... */    ref_push_type_value(bid->type);    string_builder_sprintf(s,    "Missing identifier %O %S.\n",    Pike_sp-1, bid->name);    pop_stack();    continue;    }    -  if (!pike_types_le(bid->type, ID_FROM_INT(a, i)->type)) { +  if (!pike_types_le(bid->type, ID_FROM_INT(a, i)->type, 0, 0)) {    ref_push_type_value(bid->type);    ref_push_type_value(ID_FROM_INT(a, i)->type);    if(!match_types(ID_FROM_INT(a,i)->type, bid->type)) {    string_builder_sprintf(s,    "Type of identifier %S does not match.\n"    "Expected: %O.\n"    "Got : %O.\n",    bid->name,    Pike_sp-2,    Pike_sp-1);