pike.git / src / las.cmod

version» Context lines:

pike.git/src/las.cmod:3660:    * tmp->foo = 7; // Multi-assign.    * /grubba 2007-04-27    */    if (((CAR(n)->token != F_INDEX && CAR(n)->token != F_ARROW) ||    !(match_types(array_type_string, CAAR(n)->type))) &&    !match_types(CAR(n)->type, CDR(n)->type)) {    yytype_report(REPORT_ERROR, NULL, 0, CAR(n)->type,    NULL, 0, CDR(n)->type,    0, "Bad type in assignment.");    } else { -  if (c->lex.pragmas & ID_STRICT_TYPES) { +  if ((c->lex.pragmas & ID_STRICT_TYPES) && +  (CDR(n)->type != zero_type_string)) {    struct pike_string *t1 = describe_type(CDR(n)->type);    struct pike_string *t2 = describe_type(CAR(n)->type);   #ifdef PIKE_DEBUG    if (l_flag > 0) {    fputs("Warning: Invalid assignment: ", stderr);    print_tree(n);    }   #endif /* PIKE_DEBUG */    yywarning("An expression of type %S cannot be assigned to "    "a variable of type %S.", t1, t2);
pike.git/src/las.cmod:3807:    * tmp->foo += 7; // Multi-assign.    * /grubba 2007-04-27    */    if (((CAR(n)->token != F_INDEX && CAR(n)->token != F_ARROW) ||    !(match_types(array_type_string, CAAR(n)->type))) &&    !match_types(CAR(n)->type, f)) {    yytype_report(REPORT_ERROR, NULL, 0, CAR(n)->type,    NULL, 0, f,    0, "Bad type in assignment.");    } else { -  if (c->lex.pragmas & ID_STRICT_TYPES) { +  if ((c->lex.pragmas & ID_STRICT_TYPES) && +  (f != zero_type_string)) {    struct pike_string *t1 = describe_type(f);    struct pike_string *t2 = describe_type(CAR(n)->type);   #ifdef PIKE_DEBUG    if (l_flag > 0) {    fputs("Warning: Invalid assignment: ", stderr);    print_tree(n);    }   #endif /* PIKE_DEBUG */    yywarning("An expression of type %S cannot be assigned to "    "a variable of type %S.", t1, t2);