scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 06c8e5d1ac23831304404343c9f07110540ae354
parent 139e71769f1473cf942b020d4eb60cf6221f6db9
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 18 Mar 2014 07:45:22 +0100

Remove redundant test of int default declarations

This check is done in in specifier, and since it is not going to
be a common case, it is better remove the redundant code and have
only the specifier version.

Diffstat:
Mdecl.c | 14++------------
1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/decl.c b/decl.c @@ -314,14 +314,9 @@ fielddcl(struct ctype *base, uint8_t ns) struct symbol *sym; switch (yytoken) { - case IDEN: - warn(options.implicit, - "type defaults to 'int' in declaration"); - tp = inttype; - break; case SCLASS: error("storage class '%s' in struct/union field", yytext); - case TYPE: case TQUALIFIER: + case IDEN: case TYPE: case TQUALIFIER: tp = specifier(NULL); break; case ';': @@ -470,12 +465,7 @@ extdecl(void) forbid_eof = 1; switch (yytoken) { - case IDEN: - warn(options.implicit, - "type defaults to 'int' in declaration"); - tp = inttype; - break; - case TYPE: case SCLASS: case TQUALIFIER: + case IDEN: TYPE: case SCLASS: case TQUALIFIER: tp = specifier(&sclass); if (sclass == REGISTER || sclass == AUTO) error("incorrect storage class for file-scope declaration");