From e5e449a0968899782ece9c0b740056ba5ffc697d Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Tue, 16 Sep 2008 18:06:30 +0000 Subject: [PATCH] Use the real error type instead of ATOMIC_TYPE_INVALID, when parsing type specifiers, to avoid strange errors/warnings later on. [r22016] --- parser.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/parser.c b/parser.c index a998f4d..7c66bb8 100644 --- a/parser.c +++ b/parser.c @@ -3588,10 +3588,8 @@ warn_about_long_long: default: /* invalid specifier combination, give an error message */ if (type_specifiers == 0) { - if (saw_error) { - specifiers->type = type_error_type; - return; - } + if (saw_error) + goto end_error; if (!strict_mode) { if (warning.implicit_int) { @@ -3610,15 +3608,13 @@ warn_about_long_long: } else { errorf(HERE, "multiple datatypes in declaration"); } - atomic_type = ATOMIC_TYPE_INVALID; + goto end_error; } - if (type_specifiers & SPECIFIER_COMPLEX && - atomic_type != ATOMIC_TYPE_INVALID) { + if (type_specifiers & SPECIFIER_COMPLEX) { type = allocate_type_zero(TYPE_COMPLEX, &builtin_source_position); type->complex.akind = atomic_type; - } else if (type_specifiers & SPECIFIER_IMAGINARY && - atomic_type != ATOMIC_TYPE_INVALID) { + } else if (type_specifiers & SPECIFIER_IMAGINARY) { type = allocate_type_zero(TYPE_IMAGINARY, &builtin_source_position); type->imaginary.akind = atomic_type; } else { -- 2.20.1