scc

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

commit 5d1fa00cb66c884cfe379f81102eae6451d72ee7
parent d04a92e4e8dc5714985476ba7f99683ee6818a58
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 12 Mar 2014 09:33:52 +0100

Forbid sign modifier in floating types

Diffstat:
Mtypes.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/types.c b/types.c @@ -139,7 +139,7 @@ ctype(struct ctype *tp, unsigned char tok) goto two_or_more; type = FLOAT; if (tp->c_signed || tp->c_unsigned) - goto check_sign; + goto invalid_sign; break; case DOUBLE: if (type) @@ -149,7 +149,7 @@ ctype(struct ctype *tp, unsigned char tok) else if (type == LONG) type = LDOUBLE; if (tp->c_signed || tp->c_unsigned) - goto check_sign; + goto invalid_sign; break; case UNSIGNED: if (tp->c_unsigned) @@ -166,7 +166,7 @@ ctype(struct ctype *tp, unsigned char tok) tp->c_signed = 1; check_sign: switch (type) { - case VOID: case BOOL: case STRUCT: case UNION: case ENUM: + case VOID: case BOOL: case FLOAT: case DOUBLE: case LDOUBLE: goto invalid_sign; } break;