X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=parser.c;h=225f3b494f4af3566b37925b9f20d50857dbd4c5;hb=c91a949920b54a81853baa202dc1373194825def;hp=d5a31ad275e1fb11caacdabb330f7960b1132203;hpb=a6c3a1daa3dbee585c0a29ca6fc388401907a78e;p=cparser diff --git a/parser.c b/parser.c index d5a31ad..225f3b4 100644 --- a/parser.c +++ b/parser.c @@ -6314,10 +6314,10 @@ static expression_t *parse_character_constant(void) cnst->conste.v.character = token.v.string; if (cnst->conste.v.character.size != 1) { - if (warning.multichar && GNU_MODE) { + if (!GNU_MODE) { + errorf(HERE, "more than 1 character in character constant"); + } else if (warning.multichar) { warningf(HERE, "multi-character character constant"); - } else { - errorf(HERE, "more than 1 characters in character constant"); } } next_token(); @@ -6335,10 +6335,10 @@ static expression_t *parse_wide_character_constant(void) cnst->conste.v.wide_character = token.v.wide_string; if (cnst->conste.v.wide_character.size != 1) { - if (warning.multichar && GNU_MODE) { + if (!GNU_MODE) { + errorf(HERE, "more than 1 character in character constant"); + } else if (warning.multichar) { warningf(HERE, "multi-character character constant"); - } else { - errorf(HERE, "more than 1 characters in character constant"); } } next_token(); @@ -7442,8 +7442,6 @@ static expression_t *parse_typeprop(expression_kind_t const kind) eat(kind == EXPR_SIZEOF ? T_sizeof : T___alignof__); - char const* const what = kind == EXPR_SIZEOF ? "sizeof" : "alignof"; - /* we only refer to a type property, mark this case */ bool old = in_type_prop; in_type_prop = true; @@ -7481,6 +7479,7 @@ typeprop_expression: type->kind == TYPE_BITFIELD ? "bitfield" : NULL; if (wrong_type != NULL) { + char const* const what = kind == EXPR_SIZEOF ? "sizeof" : "alignof"; errorf(&tp_expression->base.source_position, "operand of %s expression must not be of %s type '%T'", what, wrong_type, orig_type);