shithub: scc

Download patch

ref: 5d1fa00cb66c884cfe379f81102eae6451d72ee7
parent: d04a92e4e8dc5714985476ba7f99683ee6818a58
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Mar 12 05:33:52 EDT 2014

Forbid sign modifier in floating types

--- a/types.c
+++ b/types.c
@@ -139,7 +139,7 @@
 			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 @@
 		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 @@
 		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;