From: Nick Bowler Date: Thu, 7 Jul 2011 23:45:04 +0000 (-0400) Subject: Reject mixed type names / declarations. X-Git-Tag: v1~140 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/fc48450a914614dd961b09bed9c2e98c6f3b5693 Reject mixed type names / declarations. Things like int,; make little sense. Reject it. --- diff --git a/src/parse-decl.c b/src/parse-decl.c index c088471..0cf830d 100644 --- a/src/parse-decl.c +++ b/src/parse-decl.c @@ -401,6 +401,11 @@ struct cdecl *cdecl_parse_decl(const char *declstr) if (!valid_declspecs(i, true)) goto err; + + if (is_abstract(i->declarators) && (i != decl || i->next)) { + fprintf(stderr, "mixing type names and declarations is not allowed\n"); + goto err; + } } return decl;