scc

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

commit 8b63549d2bedf450ed8dd6d0087216b752b0ef14
parent 73041929f237049e6597795c34eb61d6a64ca28f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 20 Jun 2016 17:40:08 +0200

[cc1] Fix parsing of long double

An anciant version of the token encoding had LLONG equal to 2*LONG,
but this is not true since long time ago. The problem in this complex
type check is that double is equal to long float.

Diffstat:
Mcc1/types.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cc1/types.c b/cc1/types.c @@ -145,7 +145,10 @@ ctype(unsigned type, unsigned sign, unsigned size) case DOUBLE: if (size == LLONG) goto invalid_type; - size += LONG; + if (size == LONG) + size = LLONG; + else + size = LONG; goto floating; case FLOAT: if (size == LLONG)