Home | History | Annotate | Download | only in lint1

Lines Matching refs:tn

412 check_case_label_enum(const tnode_t *tn, const control_statement *cs)
416 if (!(tn->tn_type->t_is_enum || cs->c_switch_type->t_is_enum))
418 if (tn->tn_type->t_is_enum && cs->c_switch_type->t_is_enum &&
419 tn->tn_type->u.enumer == cs->c_switch_type->u.enumer)
425 type_name(tn->tn_type));
458 check_case_label(tnode_t *tn)
470 if (tn == NULL)
473 if (tn->tn_op != CON) {
479 if (!is_integer(tn->tn_type->t_tspec)) {
485 check_case_label_bitand(tn, cs->c_switch_expr);
486 check_case_label_enum(tn, cs);
496 tspec_t t = tn->tn_type->t_tspec;
502 val_t *v = integer_constant(tn, true);
513 case_label(tnode_t *tn)
515 check_case_label(tn);
547 check_controlling_expression(tnode_t *tn, bool is_do_while)
549 tn = cconv(tn);
550 if (tn != NULL)
551 tn = promote(NOOP, false, tn);
553 if (tn != NULL && !is_scalar(tn->tn_type->t_tspec)) {
562 if (tn != NULL && Tflag
563 && !is_typeok_bool_compares_with_zero(tn, is_do_while)) {
565 error(333, tn->tn_type->t_is_enum ? expr_type_name(tn)
566 : tspec_name(tn->tn_type->t_tspec));
569 return tn;
573 stmt_if_expr(tnode_t *tn)
575 if (tn != NULL)
576 tn = check_controlling_expression(tn, false);
577 if (tn != NULL)
578 expr(tn, false, true, false, false, "if");
581 if (tn != NULL && tn->tn_op == CON && !tn->tn_system_dependent) {
583 set_reached(constant_is_nonzero(tn));
611 stmt_switch_expr(tnode_t *tn)
613 if (tn != NULL)
614 tn = cconv(tn);
615 if (tn != NULL)
616 tn = promote(NOOP, false, tn);
617 if (tn != NULL && !is_integer(tn->tn_type->t_tspec)) {
620 tn = NULL;
622 if (tn != NULL && !allow_c90) {
623 tspec_t t = tn->tn_type->t_tspec;
635 if (tn != NULL) {
636 tp->t_tspec = tn->tn_type->t_tspec;
637 if ((tp->t_is_enum = tn->tn_type->t_is_enum) != false)
638 tp->u.enumer = tn->tn_type->u.enumer;
647 expr(tn, true, false, false, false, "switch");
652 cstmt->c_switch_expr = tn;
711 stmt_while_expr(tnode_t *tn)
718 if (tn != NULL)
719 tn = check_controlling_expression(tn, false);
723 cstmt->c_maybe_endless = is_nonzero(tn);
724 bool body_reached = !is_zero(tn);
726 check_getopt_begin_while(tn);
727 expr(tn, false, true, true, false, "while");
751 stmt_do_while_expr(tnode_t *tn)
756 if (tn != NULL)
757 tn = check_controlling_expression(tn, true);
759 if (tn != NULL && tn->tn_op == CON) {
760 cstmt->c_maybe_endless = constant_is_nonzero(tn);
766 expr(tn, false, true, true, true, "do-while");
902 is_parenthesized(const tnode_t *tn)
904 while (!tn->tn_parenthesized && tn->tn_op == COMMA)
905 tn = tn->u.ops.right;
906 return tn->tn_parenthesized && !tn->tn_sys;
910 check_return_value(bool sys, tnode_t *tn)
912 if (any_query_enabled && is_parenthesized(tn))
923 tnode_t *retn = build_binary(ln, RETURN, sys, tn);
939 stmt_return(bool sys, tnode_t *tn)
952 if (tn != NULL)
957 if (tn != NULL && funcsym->s_type->t_subt->t_tspec == VOID) {
961 tn = NULL;
963 if (tn == NULL && funcsym->s_type->t_subt->t_tspec != VOID
973 if (tn != NULL)
974 check_return_value(sys, tn);